mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-29 18:09:25 +01:00
do not ignore reminder audio stream settings on Android Oreo
This commit is contained in:
parent
9812c079f2
commit
cb82bc66f2
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user