I'm setting the NotificationCompat.Builder with:
.setSound(getNotificationSound(), AudioManager.STREAM_ALARM)
.setCategory(NotificationCompat.CATEGORY_ALARM)
.setPriority(NotificationCompat.PRIORITY_MAX)
among the other mandatory properties.
For the NotificationChannel that I'm using, I added:
.setBypassDnd(true)
For Oreo, the problem is that:
- the fired notification doesn't have any sound when the phone is muted or on vibrate so it's not acting like an alarm
What's the point of Do not disturb custom exception toggle button from a notification category/channel? Can it help to achieve my goal because I didn't see any differences?
For versions older than Oreo, where I'm not using the NotificationChannel I have a behavior which I prefer:
- notification sound works when the phone is muted but no vibration
- notification sound AND vibration works when the phone is on vibration or with sound enabled
Any ideas how to solve this inconsistency?