mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
catch security exceptions thrown at alarm setRepeating
This commit is contained in:
@@ -278,7 +278,10 @@ fun Context.scheduleCalDAVSync(activate: Boolean) {
|
|||||||
|
|
||||||
if (activate) {
|
if (activate) {
|
||||||
val syncCheckInterval = 4 * AlarmManager.INTERVAL_HOUR
|
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 {
|
} else {
|
||||||
alarm.cancel(pendingIntent)
|
alarm.cancel(pendingIntent)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user