mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
Disable server alerts by default for Play Store version
This commit is contained in:
@@ -223,6 +223,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private SeekBar sbMaxBackOff;
|
||||
private SwitchCompat swLogarithmicBackoff;
|
||||
private SwitchCompat swExactAlarms;
|
||||
private SwitchCompat swServerAlerts;
|
||||
private SwitchCompat swNativeDkim;
|
||||
private SwitchCompat swNativeArc;
|
||||
private EditText etNativeArcWhitelist;
|
||||
@@ -312,7 +313,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
"imap_compress", "auth_plain", "auth_login", "auth_ntlm", "auth_sasl", "auth_apop", "use_top", "forget_top",
|
||||
"keep_alive_poll", "empty_pool", "idle_done", "fast_fetch",
|
||||
"max_backoff_power", "logarithmic_backoff",
|
||||
"exact_alarms",
|
||||
"exact_alarms", "server_alerts",
|
||||
"native_dkim", "native_arc", "native_arc_whitelist", "strict_alignment",
|
||||
"svg", "webp", "animate_images",
|
||||
"preview_hidden", "preview_quotes",
|
||||
@@ -497,6 +498,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
sbMaxBackOff = view.findViewById(R.id.sbMaxBackOff);
|
||||
swLogarithmicBackoff = view.findViewById(R.id.swLogarithmicBackoff);
|
||||
swExactAlarms = view.findViewById(R.id.swExactAlarms);
|
||||
swServerAlerts = view.findViewById(R.id.swServerAlerts);
|
||||
swNativeDkim = view.findViewById(R.id.swNativeDkim);
|
||||
swNativeArc = view.findViewById(R.id.swNativeArc);
|
||||
etNativeArcWhitelist = view.findViewById(R.id.etNativeArcWhitelist);
|
||||
@@ -1651,6 +1653,13 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
}
|
||||
});
|
||||
|
||||
swServerAlerts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
prefs.edit().putBoolean("server_alerts", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swNativeDkim.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -2651,6 +2660,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
|
||||
swLogarithmicBackoff.setChecked(prefs.getBoolean("logarithmic_backoff", true));
|
||||
swExactAlarms.setChecked(prefs.getBoolean("exact_alarms", true));
|
||||
swServerAlerts.setChecked(prefs.getBoolean("server_alerts", !Helper.isPlayStoreInstall()));
|
||||
swNativeDkim.setEnabled(!BuildConfig.PLAY_STORE_RELEASE || true);
|
||||
swNativeDkim.setChecked(prefs.getBoolean("native_dkim", false));
|
||||
swNativeArc.setEnabled(swNativeDkim.isEnabled() && swNativeDkim.isChecked());
|
||||
|
||||
@@ -1717,7 +1717,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
EntityLog.log(ServiceSynchronize.this, EntityLog.Type.Account, account,
|
||||
account.name + " alert: " + message);
|
||||
|
||||
if (!ConnectionHelper.isMaxConnections(message))
|
||||
if (!ConnectionHelper.isMaxConnections(message) &&
|
||||
prefs.getBoolean("server_alerts", !Helper.isPlayStoreInstall()))
|
||||
try {
|
||||
NotificationManager nm =
|
||||
Helper.getSystemService(ServiceSynchronize.this, NotificationManager.class);
|
||||
|
||||
@@ -1680,6 +1680,17 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/tvLogarithmicBackoffHint"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swServerAlerts"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_advanced_server_alerts"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swExactAlarms"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swNativeDkim"
|
||||
android:layout_width="0dp"
|
||||
@@ -1688,7 +1699,7 @@
|
||||
android:text="@string/title_advanced_native_dkim"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/swExactAlarms"
|
||||
app:layout_constraintTop_toBottomOf="@id/swServerAlerts"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -1016,6 +1016,7 @@
|
||||
<string name="title_advanced_keep_alive_poll" translatable="false">Poll on keep-alive</string>
|
||||
<string name="title_advanced_empty_pool" translatable="false">Empty connection pool</string>
|
||||
<string name="title_advanced_exact_alarms" translatable="false">Use exact timers</string>
|
||||
<string name="title_advanced_server_alerts" translatable="false">Server alerts</string>
|
||||
<string name="title_advanced_native_dkim" translatable="false">Native DKIM verification</string>
|
||||
<string name="title_advanced_native_arc" translatable="false">Native ARC verification</string>
|
||||
<string name="title_advanced_strict_alignment" translatable="false">Strict alignment</string>
|
||||
|
||||
Reference in New Issue
Block a user