diff --git a/FAQ.md b/FAQ.md index 32e012165d..34d22d0bc1 100644 --- a/FAQ.md +++ b/FAQ.md @@ -3926,16 +3926,12 @@ There is no auto discovery for POP3. **(175) Why should battery optimizations be disabled?** -If battery optimizations ([Doze mode](https://developer.android.com/training/monitoring-device-state/doze-standby)) are enabled, +If battery optimizations are enabled ([Doze mode](https://developer.android.com/training/monitoring-device-state/doze-standby)), Android might stop the app, which will result in not sending and receiving messages anymore. -It shouldn't be necessary to disable battery optimizations for Android version 11 or earlier, +It shouldn't be necessary to disable battery optimizations, but unfortunately modifications by manufacturers often [require it anyway](https://dontkillmyapp.com/). -For Android 12 or later, battery optimizations need to be disabled to receive push messages -due to [strict foreground restrictions](https://developer.android.com/about/versions/12/foreground-services). -If battery optimizations are enabled, the app will periodically check for messages. -

Get support

diff --git a/app/src/main/java/eu/faircode/email/ApplicationEx.java b/app/src/main/java/eu/faircode/email/ApplicationEx.java index 890b866784..86ddfd1a7c 100644 --- a/app/src/main/java/eu/faircode/email/ApplicationEx.java +++ b/app/src/main/java/eu/faircode/email/ApplicationEx.java @@ -196,7 +196,7 @@ public class ApplicationEx extends Application DisconnectBlacklist.init(this); - if (!Helper.isOptimizing12(this)) { + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) { ServiceSynchronize.watchdog(this); ServiceSend.watchdog(this); } @@ -521,9 +521,6 @@ public class ApplicationEx extends Application } else if (version < 1721) { if (!prefs.contains("discard_delete")) editor.putBoolean("discard_delete", false); - } else if (version < 1732) { - if (Helper.isOptimizing12(context)) - editor.remove("setup_reminder"); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG) diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index 2fa5d3823c..4831b743ec 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -434,7 +434,7 @@ public class Helper { } static boolean isOptimizing12(Context context) { - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) + if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || true) return false; Boolean ignoring = Helper.isIgnoringOptimizations(context);