diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt index d73a2560..567c5ccd 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/extensions/Context.kt @@ -251,9 +251,9 @@ fun Context.getTimerNotification(pendingIntent: PendingIntent, addDeleteIntent: val channelId = "simple_timer_channel_$soundUri" if (isOreoPlus()) { val audioAttributes = AudioAttributes.Builder() - .setUsage(AudioAttributes.USAGE_NOTIFICATION) + .setUsage(AudioAttributes.USAGE_ALARM) .setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION) - .setLegacyStreamType(AudioManager.STREAM_SYSTEM) + .setLegacyStreamType(AudioManager.STREAM_ALARM) .setFlags(AudioAttributes.FLAG_AUDIBILITY_ENFORCED) .build() @@ -278,7 +278,7 @@ fun Context.getTimerNotification(pendingIntent: PendingIntent, addDeleteIntent: .setPriority(Notification.PRIORITY_LOW) .setDefaults(Notification.DEFAULT_LIGHTS) .setAutoCancel(true) - .setSound(Uri.parse(soundUri), AudioManager.STREAM_SYSTEM) + .setSound(Uri.parse(soundUri), AudioManager.STREAM_ALARM) .setChannelId(channelId) .addAction(R.drawable.ic_cross, getString(R.string.dismiss), if (addDeleteIntent) reminderActivityIntent else getHideTimerPendingIntent()) diff --git a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt index cfbb52f7..b1d4d2a7 100644 --- a/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt +++ b/app/src/main/kotlin/com/simplemobiletools/clock/fragments/TimerFragment.kt @@ -71,7 +71,7 @@ class TimerFragment : Fragment() { } timer_sound.setOnClickListener { - SelectAlarmSoundDialog(activity as SimpleActivity, config.timerSoundUri, AudioManager.STREAM_SYSTEM, PICK_AUDIO_FILE_INTENT_ID, + SelectAlarmSoundDialog(activity as SimpleActivity, config.timerSoundUri, AudioManager.STREAM_ALARM, PICK_AUDIO_FILE_INTENT_ID, ALARM_SOUND_TYPE_ALARM, true, onAlarmPicked = { if (it != null) { updateAlarmSound(it)