mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-02 07:06:18 +02:00
Debug: added max back-off slider
This commit is contained in:
@@ -213,6 +213,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private SwitchCompat swEmptyPool;
|
||||
private SwitchCompat swIdleDone;
|
||||
private SwitchCompat swFastFetch;
|
||||
private TextView tvMaxBackoff;
|
||||
private SeekBar sbMaxBackOff;
|
||||
private SwitchCompat swLogarithmicBackoff;
|
||||
private SwitchCompat swExactAlarms;
|
||||
private SwitchCompat swInfra;
|
||||
@@ -271,7 +273,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
"show_recent",
|
||||
"use_modseq", "preamble", "uid_command", "perform_expunge", "uid_expunge",
|
||||
"auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top",
|
||||
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch", "logarithmic_backoff",
|
||||
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch",
|
||||
"max_backoff_power", "logarithmic_backoff",
|
||||
"exact_alarms", "infra", "dkim_verify", "dup_msgids", "global_keywords", "test_iab"
|
||||
};
|
||||
|
||||
@@ -433,6 +436,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swEmptyPool = view.findViewById(R.id.swEmptyPool);
|
||||
swIdleDone = view.findViewById(R.id.swIdleDone);
|
||||
swFastFetch = view.findViewById(R.id.swFastFetch);
|
||||
tvMaxBackoff = view.findViewById(R.id.tvMaxBackoff);
|
||||
sbMaxBackOff = view.findViewById(R.id.sbMaxBackOff);
|
||||
swLogarithmicBackoff = view.findViewById(R.id.swLogarithmicBackoff);
|
||||
swExactAlarms = view.findViewById(R.id.swExactAlarms);
|
||||
swInfra = view.findViewById(R.id.swInfra);
|
||||
@@ -1549,6 +1554,23 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
sbMaxBackOff.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
|
||||
@Override
|
||||
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
|
||||
prefs.edit().putInt("max_backoff_power", progress).apply();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStartTrackingTouch(SeekBar seekBar) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
|
||||
swLogarithmicBackoff.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -2263,6 +2285,12 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
swEmptyPool.setChecked(prefs.getBoolean("empty_pool", true));
|
||||
swIdleDone.setChecked(prefs.getBoolean("idle_done", true));
|
||||
swFastFetch.setChecked(prefs.getBoolean("fast_fetch", false));
|
||||
|
||||
int max_backoff_power = prefs.getInt("max_backoff_power", ServiceSynchronize.DEFAULT_BACKOFF_POWER - 3);
|
||||
int max_backoff = (int) Math.pow(2, max_backoff_power + 3);
|
||||
tvMaxBackoff.setText(getString(R.string.title_advanced_max_backoff, max_backoff));
|
||||
sbMaxBackOff.setProgress(max_backoff_power);
|
||||
|
||||
swLogarithmicBackoff.setChecked(prefs.getBoolean("logarithmic_backoff", true));
|
||||
swExactAlarms.setChecked(prefs.getBoolean("exact_alarms", true));
|
||||
swInfra.setChecked(prefs.getBoolean("infra", false));
|
||||
|
||||
Reference in New Issue
Block a user