Merge pull request #3818 from deltachat/adb/tune-down-fetchworker

don't use FetchWorker if we have push notifications
This commit is contained in:
adb 2025-07-22 13:36:08 +00:00 committed by GitHub
commit 10345ab8c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -197,6 +197,12 @@ public class ApplicationContext extends MultiDexApplication {
}
}, filter);
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
if (Prefs.isPushEnabled(this)) {
FcmReceiveService.register(this);
} else {
Log.i(TAG, "FCM disabled at build time");
// MAYBE TODO: i think the ApplicationContext is also created
// when the app is stated by FetchWorker timeouts.
// in this case, the normal threads shall not be started.
@ -215,12 +221,6 @@ public class ApplicationContext extends MultiDexApplication {
"FetchWorker",
ExistingPeriodicWorkPolicy.KEEP,
fetchWorkRequest);
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
if (Prefs.isPushEnabled(this)) {
FcmReceiveService.register(this);
} else {
Log.i(TAG, "FCM disabled at build time");
}
}