<commit_before>package org.alex.wirelesscontroller;

import android.content.Context;
import android.preference.PreferenceManager;

import java.util.HashSet;
import java.util.Set;

public class AppPreferences {

    public static final String PREF_STOP_IN_AIRPLANE_MODE = "prefStopInAirplaneMode";
    public static final String PREF_WIFI_WHITELIST = "prefWifiWhitelist";
    public static final String PREF_ENABLE_WHITELIST = "prefEnableWhitelist";
    public static final String PREF_IS_ALARM_ON = "prefIsAlarmOn";
    public static final String PREF_START_TIME = "prefStartTime";
    public static final String PREF_END_TIME = "prefEndTime";
    public static final String PREF_REPEAT_DISABLE_WIRELESS = "prefRepeatDisableWireless";
    public static final String PREF_SERVICE_RUN_INTERVAL = "prefServiceRunInterval";
    public static final String PREF_FORCE_DISABLED_WIRELESS = "prefForceDisabledWireless";
    public static final String PREF_DISABLE_WIRELESS = "prefDisableWireless";
    public static final String PREF_DISABLE_BLUETOOTH = "prefDisableBluetooth";

    public static boolean getPrefStopInAirplaneMode(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(PREF_STOP_IN_AIRPLANE_MODE, true);
    }

    public static void setPrefStopInAirplaneMode(Context context, boolean value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putBoolean(PREF_STOP_IN_AIRPLANE_MODE, value)
                .apply();
    }

    public static Set<String> getPrefWifiWhitelist(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getStringSet(PREF_WIFI_WHITELIST, new HashSet<String>());
    }

    public static void setPrefWifiWhitelist(Context context, Set<String> values) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putStringSet(PREF_WIFI_WHITELIST, values)
                .apply();
    }

    public static boolean getPrefEnableWhitelist(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(PREF_ENABLE_WHITELIST, false);
    }

    public static void setPrefEnableWhitelist(Context context, boolean value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putBoolean(PREF_ENABLE_WHITELIST, value)
                .apply();
    }

    public static boolean getPrefIsAlarmOn(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(PREF_IS_ALARM_ON, false);
    }

    public static void setPrefIsAlarmOn(Context context, boolean isOn) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putBoolean(PREF_IS_ALARM_ON, isOn)
                .apply();
    }

    public static String getPrefStartTime(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getString(PREF_START_TIME, TimePickerFragment.START_TIME_DEFAULT);
    }

    public static void setPrefStartTime(Context context, String value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putString(PREF_START_TIME, value)
                .apply();
    }

    public static String getPrefEndTime(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getString(PREF_END_TIME, TimePickerFragment.START_TIME_DEFAULT);
    }

    public static void setPrefEndTime(Context context, String value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putString(PREF_END_TIME, value)
                .apply();
    }

    public static int getPrefRepeatDisableWireless(Context context) {
        String value = PreferenceManager.getDefaultSharedPreferences(context)
                .getString(PREF_REPEAT_DISABLE_WIRELESS, context.getString(R.string.pref_repeatDisableWireless_default));
        return Integer.parseInt(value);
    }

    public static void setPrefRepeatDisableWireless(Context context, String value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()<commit_msg>Fixed end time default value (my copy-paste)<commit_after>package org.alex.wirelesscontroller;

import android.content.Context;
import android.preference.PreferenceManager;

import java.util.HashSet;
import java.util.Set;

public class AppPreferences {

    public static final String PREF_STOP_IN_AIRPLANE_MODE = "prefStopInAirplaneMode";
    public static final String PREF_WIFI_WHITELIST = "prefWifiWhitelist";
    public static final String PREF_ENABLE_WHITELIST = "prefEnableWhitelist";
    public static final String PREF_IS_ALARM_ON = "prefIsAlarmOn";
    public static final String PREF_START_TIME = "prefStartTime";
    public static final String PREF_END_TIME = "prefEndTime";
    public static final String PREF_REPEAT_DISABLE_WIRELESS = "prefRepeatDisableWireless";
    public static final String PREF_SERVICE_RUN_INTERVAL = "prefServiceRunInterval";
    public static final String PREF_FORCE_DISABLED_WIRELESS = "prefForceDisabledWireless";
    public static final String PREF_DISABLE_WIRELESS = "prefDisableWireless";
    public static final String PREF_DISABLE_BLUETOOTH = "prefDisableBluetooth";

    public static boolean getPrefStopInAirplaneMode(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(PREF_STOP_IN_AIRPLANE_MODE, true);
    }

    public static void setPrefStopInAirplaneMode(Context context, boolean value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putBoolean(PREF_STOP_IN_AIRPLANE_MODE, value)
                .apply();
    }

    public static Set<String> getPrefWifiWhitelist(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getStringSet(PREF_WIFI_WHITELIST, new HashSet<String>());
    }

    public static void setPrefWifiWhitelist(Context context, Set<String> values) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putStringSet(PREF_WIFI_WHITELIST, values)
                .apply();
    }

    public static boolean getPrefEnableWhitelist(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(PREF_ENABLE_WHITELIST, false);
    }

    public static void setPrefEnableWhitelist(Context context, boolean value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putBoolean(PREF_ENABLE_WHITELIST, value)
                .apply();
    }

    public static boolean getPrefIsAlarmOn(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getBoolean(PREF_IS_ALARM_ON, false);
    }

    public static void setPrefIsAlarmOn(Context context, boolean isOn) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putBoolean(PREF_IS_ALARM_ON, isOn)
                .apply();
    }

    public static String getPrefStartTime(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getString(PREF_START_TIME, TimePickerFragment.START_TIME_DEFAULT);
    }

    public static void setPrefStartTime(Context context, String value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putString(PREF_START_TIME, value)
                .apply();
    }

    public static String getPrefEndTime(Context context) {
        return PreferenceManager.getDefaultSharedPreferences(context)
                .getString(PREF_END_TIME, TimePickerFragment.END_TIME_DEFAULT);
    }

    public static void setPrefEndTime(Context context, String value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
                .putString(PREF_END_TIME, value)
                .apply();
    }

    public static int getPrefRepeatDisableWireless(Context context) {
        String value = PreferenceManager.getDefaultSharedPreferences(context)
                .getString(PREF_REPEAT_DISABLE_WIRELESS, context.getString(R.string.pref_repeatDisableWireless_default));
        return Integer.parseInt(value);
    }

    public static void setPrefRepeatDisableWireless(Context context, String value) {
        PreferenceManager.getDefaultSharedPreferences(context)
                .edit()
{'fraction_non_alphanumeric': 0.06694129763130793, 'fraction_numerical': 0.0, 'mean_word_length': 3.2344961240310077, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5107006', 'n_tokens_mistral': 2376, 'n_tokens_neox': 2305, 'n_words': 459}