Fixed send lifecycle

This commit is contained in:
M66B 2021-08-31 21:11:12 +02:00
parent b0297fb6c5
commit c711357f07
1 changed files with 3 additions and 1 deletions

View File

@ -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<Long> 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");