Disable Android 12 doze requirement

pull/206/head
M66B 3 years ago
parent 30b4314c7c
commit eb6652ad6a

@ -3926,16 +3926,12 @@ There is no auto discovery for POP3.
<a name="faq175"></a> <a name="faq175"></a>
**(175) Why should battery optimizations be disabled?** **(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. 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/). 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.
<br /> <br />
<h2><a name="get-support"></a>Get support</h2> <h2><a name="get-support"></a>Get support</h2>

@ -196,7 +196,7 @@ public class ApplicationEx extends Application
DisconnectBlacklist.init(this); DisconnectBlacklist.init(this);
if (!Helper.isOptimizing12(this)) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
ServiceSynchronize.watchdog(this); ServiceSynchronize.watchdog(this);
ServiceSend.watchdog(this); ServiceSend.watchdog(this);
} }
@ -521,9 +521,6 @@ public class ApplicationEx extends Application
} else if (version < 1721) { } else if (version < 1721) {
if (!prefs.contains("discard_delete")) if (!prefs.contains("discard_delete"))
editor.putBoolean("discard_delete", false); 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) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)

@ -434,7 +434,7 @@ public class Helper {
} }
static boolean isOptimizing12(Context context) { 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; return false;
Boolean ignoring = Helper.isIgnoringOptimizations(context); Boolean ignoring = Helper.isIgnoringOptimizations(context);

Loading…
Cancel
Save