delete notification channels only on Android Oreo

This commit is contained in:
tibbi
2019-01-08 15:56:48 +01:00
parent 26151b22ca
commit 0e58358287

View File

@ -214,8 +214,10 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content:
// create a new channel for every new sound uri as the new Android Oreo notification system is fundamentally broken
if (soundUri != config.lastSoundUri || config.lastVibrateOnReminder != config.vibrateOnReminder) {
if (!publicVersion) {
val oldChannelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}"
notificationManager.deleteNotificationChannel(oldChannelId)
if (isOreoPlus()) {
val oldChannelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}"
notificationManager.deleteNotificationChannel(oldChannelId)
}
}
config.lastVibrateOnReminder = config.vibrateOnReminder