diff --git a/app/src/main/java/eu/faircode/email/ServiceSend.java b/app/src/main/java/eu/faircode/email/ServiceSend.java index 9e75d91192..5b28bbc189 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSend.java +++ b/app/src/main/java/eu/faircode/email/ServiceSend.java @@ -68,8 +68,8 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar private Network lastActive = null; private boolean lastSuitable = false; + private TwoStateOwner owner; private PowerManager.WakeLock wlOutbox; - private TwoStateOwner owner = new TwoStateOwner("send"); private List handling = new ArrayList<>(); private static ExecutorService executor = Helper.getBackgroundExecutor(1, "send"); @@ -86,6 +86,8 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar startForeground(NotificationHelper.NOTIFICATION_SEND, getNotificationService().build()); + owner = new TwoStateOwner(this, "send"); + PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wlOutbox = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, BuildConfig.APPLICATION_ID + ":send");