Merge pull request #508 from esensar/fix/upcoming-disabled-alarm-notification

Cancel early dismissal notification when cancelling alarm
This commit is contained in:
Tibor Kaputa 2023-08-31 16:46:30 +02:00 committed by GitHub
commit e7a22bf975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -195,6 +195,7 @@ fun Context.getAlarmIntent(alarm: Alarm): PendingIntent {
fun Context.cancelAlarmClock(alarm: Alarm) { fun Context.cancelAlarmClock(alarm: Alarm) {
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
alarmManager.cancel(getAlarmIntent(alarm)) alarmManager.cancel(getAlarmIntent(alarm))
alarmManager.cancel(getEarlyAlarmDismissalIntent(alarm))
} }
fun Context.hideNotification(id: Int) { fun Context.hideNotification(id: Int) {