Make alarms created by Intent single shot if created without UI

This commit is contained in:
Ensar Sarajčić
2023-08-31 15:57:15 +02:00
parent fe490f6683
commit d69d25907b
8 changed files with 56 additions and 10 deletions

View File

@ -27,7 +27,12 @@ class DismissAlarmReceiver : BroadcastReceiver() {
context.cancelAlarmClock(alarm)
scheduleNextAlarm(alarm, context)
if (alarm.days < 0) {
context.dbHelper.updateAlarmEnabledState(alarm.id, false)
if (alarm.oneShot) {
alarm.isEnabled = false
context.dbHelper.deleteAlarms(arrayListOf(alarm))
} else {
context.dbHelper.updateAlarmEnabledState(alarm.id, false)
}
context.updateWidgets()
}
}