Android 12 foreground restrictions

This commit is contained in:
M66B
2021-09-23 20:06:00 +02:00
parent 0903fb77ea
commit 244b6df87e
13 changed files with 94 additions and 73 deletions

View File

@@ -196,8 +196,10 @@ public class ApplicationEx extends Application
DisconnectBlacklist.init(this);
ServiceSynchronize.watchdog(this);
ServiceSend.watchdog(this);
if (!Helper.isOptimizing12(this)) {
ServiceSynchronize.watchdog(this);
ServiceSend.watchdog(this);
}
ServiceSynchronize.scheduleWatchdog(this);
WorkManager.getInstance(this).cancelUniqueWork("WorkerWatchdog");
@@ -519,6 +521,9 @@ 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)