Optional protocol logging

This commit is contained in:
M66B
2020-10-03 22:00:26 +02:00
parent 1ad69b82a7
commit a9150f84b8
5 changed files with 65 additions and 4 deletions

View File

@@ -89,6 +89,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private Button btnApp;
private Button btnMore;
private SwitchCompat swProtocol;
private SwitchCompat swDebug;
private SwitchCompat swAuthPlain;
private SwitchCompat swAuthLogin;
@@ -106,7 +107,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
private final static String[] RESET_OPTIONS = new String[]{
"shortcuts", "fts", "english", "watchdog", "updates",
"experiments", "query_threads", "crash_reports", "cleanup_attachments",
"debug", "auth_plain", "auth_login", "auth_sasl"
"protocol", "debug", "auth_plain", "auth_login", "auth_sasl"
};
private final static String[] RESET_QUESTIONS = new String[]{
@@ -149,6 +150,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
btnApp = view.findViewById(R.id.btnApp);
btnMore = view.findViewById(R.id.btnMore);
swProtocol = view.findViewById(R.id.swProtocol);
swDebug = view.findViewById(R.id.swDebug);
swAuthPlain = view.findViewById(R.id.swAuthPlain);
swAuthLogin = view.findViewById(R.id.swAuthLogin);
@@ -339,6 +341,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
}
});
swProtocol.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("protocol", checked).apply();
}
});
swAuthPlain.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -596,6 +605,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
tvUuid.setText(prefs.getString("uuid", null));
swCleanupAttachments.setChecked(prefs.getBoolean("cleanup_attachments", false));
swProtocol.setChecked(prefs.getBoolean("protocol", false));
swDebug.setChecked(prefs.getBoolean("debug", false));
swAuthPlain.setChecked(prefs.getBoolean("auth_plain", true));
swAuthLogin.setChecked(prefs.getBoolean("auth_login", true));