Added debug option to disable app chooser

This commit is contained in:
M66B
2023-08-16 11:42:45 +02:00
parent bacc3b634e
commit 261445ac4a
4 changed files with 33 additions and 6 deletions

View File

@@ -240,6 +240,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private SwitchCompat swDupMsgId;
private SwitchCompat swThreadByRef;
private SwitchCompat swMdn;
private SwitchCompat swAppChooser;
private SwitchCompat swDeleteConfirmation;
private EditText etKeywords;
private SwitchCompat swTestIab;
@@ -303,7 +304,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
"max_backoff_power", "logarithmic_backoff",
"exact_alarms",
"native_dkim", "native_arc", "native_arc_whitelist",
"infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "delete_confirmation", "global_keywords", "test_iab"
"infra", "tld_flags", "dup_msgids", "thread_byref", "mdn", "app_chooser", "delete_confirmation", "global_keywords", "test_iab"
};
private final static String[] RESET_QUESTIONS = new String[]{
@@ -492,6 +493,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swDupMsgId = view.findViewById(R.id.swDupMsgId);
swThreadByRef = view.findViewById(R.id.swThreadByRef);
swMdn = view.findViewById(R.id.swMdn);
swAppChooser = view.findViewById(R.id.swAppChooser);
swDeleteConfirmation = view.findViewById(R.id.swDeleteConfirmation);
etKeywords = view.findViewById(R.id.etKeywords);
swTestIab = view.findViewById(R.id.swTestIab);
@@ -1859,6 +1861,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swAppChooser.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("app_chooser", checked).apply();
}
});
swDeleteConfirmation.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -2612,6 +2621,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
swDupMsgId.setChecked(prefs.getBoolean("dup_msgids", false));
swThreadByRef.setChecked(prefs.getBoolean("thread_byref", true));
swMdn.setChecked(prefs.getBoolean("mdn", swExperiments.isChecked()));
swAppChooser.setChecked(prefs.getBoolean("app_chooser", true));
swDeleteConfirmation.setChecked(prefs.getBoolean("delete_confirmation", true));
etKeywords.setText(prefs.getString("global_keywords", null));
swTestIab.setChecked(prefs.getBoolean("test_iab", false));