catch and show security exceptions thrown at scheduling reminders

This commit is contained in:
tibbi 2018-12-19 17:49:07 +01:00
parent dd4a2c3d2b
commit acfec5901d

View File

@ -124,7 +124,11 @@ fun Context.scheduleEventIn(notifTS: Long, event: Event, showToasts: Boolean) {
val pendingIntent = getNotificationIntent(applicationContext, event)
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, newNotifTS, pendingIntent)
try {
AlarmManagerCompat.setExactAndAllowWhileIdle(alarmManager, AlarmManager.RTC_WAKEUP, newNotifTS, pendingIntent)
} catch (e: Exception) {
showErrorToast(e)
}
}
fun Context.cancelNotification(id: Long) {