do not ignore reminder audio stream settings on Android Oreo

This commit is contained in:
tibbi 2018-07-14 13:54:57 +02:00
parent 9812c079f2
commit cb82bc66f2
1 changed files with 1 additions and 2 deletions

View File

@ -204,13 +204,12 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content:
config.lastSoundUri = soundUri
}
val channelId = "simple_calendar_${config.lastReminderChannel}"
val channelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}"
if (isOreoPlus()) {
val audioAttributes = AudioAttributes.Builder()
.setUsage(AudioAttributes.USAGE_ALARM)
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setLegacyStreamType(config.reminderAudioStream)
.setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
.build()
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager