mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-04 10:39:25 +00:00
Cleanup back-off alarm
This commit is contained in:
parent
c5847f3ec9
commit
4115882949
1 changed files with 14 additions and 8 deletions
|
@ -1220,6 +1220,7 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
registerReceiver(alarm, new IntentFilter(id));
|
||||
|
||||
AlarmManager am = getSystemService(AlarmManager.class);
|
||||
try {
|
||||
am.setAndAllowWhileIdle(
|
||||
AlarmManager.RTC_WAKEUP,
|
||||
System.currentTimeMillis() + CONNECT_BACKOFF_AlARM * 60 * 1000L,
|
||||
|
@ -1231,6 +1232,11 @@ public class ServiceSynchronize extends LifecycleService {
|
|||
} finally {
|
||||
wl0.acquire();
|
||||
}
|
||||
} finally {
|
||||
// Cleanup
|
||||
am.cancel(pi);
|
||||
unregisterReceiver(alarm);
|
||||
}
|
||||
}
|
||||
|
||||
if (backoff < CONNECT_BACKOFF_MAX)
|
||||
|
|
Loading…
Add table
Reference in a new issue