mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Start foreground on create
Sometimes there is a significant delay between on create and on start command
This commit is contained in:
@@ -119,6 +119,7 @@ public class ServiceSynchronize extends ServiceBase {
|
||||
public void onCreate() {
|
||||
Log.i("Service create version=" + BuildConfig.VERSION_NAME);
|
||||
super.onCreate();
|
||||
startForeground(Helper.NOTIFICATION_SYNCHRONIZE, getNotificationService(null).build());
|
||||
|
||||
// Listen for network changes
|
||||
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
@@ -251,8 +252,6 @@ public class ServiceSynchronize extends ServiceBase {
|
||||
Log.i("Service command intent=" + intent + " action=" + action);
|
||||
Log.logExtras(intent);
|
||||
|
||||
startForeground(Helper.NOTIFICATION_SYNCHRONIZE, getNotificationService(null).build());
|
||||
|
||||
super.onStartCommand(intent, flags, startId);
|
||||
|
||||
if (action != null)
|
||||
|
||||
Reference in New Issue
Block a user