0

In my app, I would like to play audio. As long as my app is actively running, no other audio from any other apps should be played. I.e. no push audio notifications (e.g. WhatsApp), no call ringtones, no SMS, or anything else. Only my app should be able to play unmuted audio.

So whenever my app is running, the whole OS and the background apps should be muted, even if my app is currently not playing any audio. Is that possible?

xRay
  • 543
  • 1
  • 5
  • 29
  • There isn't any REAL solution but you could enable DoNotDisturb mode (on SDK 26+) and set Filters as Exceptions based on NotificationChannel: https://stackoverflow.com/questions/52146942/android-set-do-not-disturb-setinterruptionfilter-for-all-notifications-besi – emandt Apr 12 '21 at 15:36
  • @emandt thanks for this info. The DoNotDisturb mode is a very good option! I think the only thing that will not be muted is the alarm clock. – xRay Apr 12 '21 at 17:11

0 Answers0