catch security exceptions thrown at alarm setRepeating
This commit is contained in:
parent
ba70e6b523
commit
f994a085e1
|
@ -278,7 +278,10 @@ fun Context.scheduleCalDAVSync(activate: Boolean) {
|
|||
|
||||
if (activate) {
|
||||
val syncCheckInterval = 4 * AlarmManager.INTERVAL_HOUR
|
||||
alarm.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + syncCheckInterval, syncCheckInterval, pendingIntent)
|
||||
try {
|
||||
alarm.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + syncCheckInterval, syncCheckInterval, pendingIntent)
|
||||
} catch (ignored: SecurityException) {
|
||||
}
|
||||
} else {
|
||||
alarm.cancel(pendingIntent)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue