|
|
|
@ -59,6 +59,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
private SwitchCompat swWatchdog;
|
|
|
|
|
private SwitchCompat swOptimize;
|
|
|
|
|
private SwitchCompat swUpdates;
|
|
|
|
|
private SwitchCompat swUpdatesMain;
|
|
|
|
|
private SwitchCompat swExperiments;
|
|
|
|
|
private TextView tvExperimentsHint;
|
|
|
|
|
private SwitchCompat swCrashReports;
|
|
|
|
@ -74,10 +75,11 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
private TextView tvStorageSpace;
|
|
|
|
|
private TextView tvFingerprint;
|
|
|
|
|
|
|
|
|
|
private Group grpUpdates;
|
|
|
|
|
private Group grpDebug;
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_OPTIONS = new String[]{
|
|
|
|
|
"fts", "english", "watchdog", "auto_optimize", "updates", "experiments", "crash_reports", "debug"
|
|
|
|
|
"fts", "english", "watchdog", "auto_optimize", "updates", "updates_main", "experiments", "crash_reports", "debug"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private final static String[] RESET_QUESTIONS = new String[]{
|
|
|
|
@ -105,6 +107,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
swWatchdog = view.findViewById(R.id.swWatchdog);
|
|
|
|
|
swOptimize = view.findViewById(R.id.swOptimize);
|
|
|
|
|
swUpdates = view.findViewById(R.id.swUpdates);
|
|
|
|
|
swUpdatesMain = view.findViewById(R.id.swUpdatesMain);
|
|
|
|
|
swExperiments = view.findViewById(R.id.swExperiments);
|
|
|
|
|
tvExperimentsHint = view.findViewById(R.id.tvExperimentsHint);
|
|
|
|
|
swCrashReports = view.findViewById(R.id.swCrashReports);
|
|
|
|
@ -120,6 +123,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
tvStorageSpace = view.findViewById(R.id.tvStorageSpace);
|
|
|
|
|
tvFingerprint = view.findViewById(R.id.tvFingerprint);
|
|
|
|
|
|
|
|
|
|
grpUpdates = view.findViewById(R.id.grpUpdates);
|
|
|
|
|
grpDebug = view.findViewById(R.id.grpDebug);
|
|
|
|
|
|
|
|
|
|
setOptions();
|
|
|
|
@ -207,6 +211,14 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
NotificationManager nm = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
|
|
|
|
nm.cancel(Helper.NOTIFICATION_UPDATE);
|
|
|
|
|
}
|
|
|
|
|
swUpdatesMain.setEnabled(checked);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
swUpdatesMain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
|
|
|
|
prefs.edit().putBoolean("updates_main", checked).apply();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -384,9 +396,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
swWatchdog.setChecked(prefs.getBoolean("watchdog", true));
|
|
|
|
|
swOptimize.setChecked(prefs.getBoolean("auto_optimize", false));
|
|
|
|
|
swUpdates.setChecked(prefs.getBoolean("updates", true));
|
|
|
|
|
swUpdates.setVisibility(
|
|
|
|
|
Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(getContext())
|
|
|
|
|
? View.GONE : View.VISIBLE);
|
|
|
|
|
swUpdatesMain.setChecked(prefs.getBoolean("updates_main", false));
|
|
|
|
|
swUpdatesMain.setEnabled(swUpdates.isChecked());
|
|
|
|
|
swExperiments.setChecked(prefs.getBoolean("experiments", false));
|
|
|
|
|
swCrashReports.setChecked(prefs.getBoolean("crash_reports", false));
|
|
|
|
|
tvUuid.setText(prefs.getString("uuid", null));
|
|
|
|
@ -403,6 +414,10 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|
|
|
|
Helper.humanReadableByteCount(Helper.getTotalStorageSpace(), true)));
|
|
|
|
|
tvFingerprint.setText(Helper.getFingerprint(getContext()));
|
|
|
|
|
|
|
|
|
|
grpUpdates.setVisibility(!BuildConfig.DEBUG &&
|
|
|
|
|
(Helper.isPlayStoreInstall() || !Helper.hasValidFingerprint(getContext()))
|
|
|
|
|
? View.GONE : View.VISIBLE);
|
|
|
|
|
|
|
|
|
|
grpDebug.setVisibility(swDebug.isChecked() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|