mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-06-05 21:59:17 +02:00
do not ignore reminder audio stream settings on Android Oreo
This commit is contained in:
@@ -204,13 +204,12 @@ fun Context.getNotification(pendingIntent: PendingIntent, event: Event, content:
|
|||||||
config.lastSoundUri = soundUri
|
config.lastSoundUri = soundUri
|
||||||
}
|
}
|
||||||
|
|
||||||
val channelId = "simple_calendar_${config.lastReminderChannel}"
|
val channelId = "simple_calendar_${config.lastReminderChannel}_${config.reminderAudioStream}"
|
||||||
if (isOreoPlus()) {
|
if (isOreoPlus()) {
|
||||||
val audioAttributes = AudioAttributes.Builder()
|
val audioAttributes = AudioAttributes.Builder()
|
||||||
.setUsage(AudioAttributes.USAGE_ALARM)
|
.setUsage(AudioAttributes.USAGE_ALARM)
|
||||||
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
|
||||||
.setLegacyStreamType(config.reminderAudioStream)
|
.setLegacyStreamType(config.reminderAudioStream)
|
||||||
.setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED)
|
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||||
|
Reference in New Issue
Block a user