play the stopwatch reminder in the Alarm stream
This commit is contained in:
parent
3a95fe601b
commit
dc31b34db7
2 changed files with 4 additions and 4 deletions
|
@ -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())
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue