How to mute sound and vibration for all notifications in Android 5.0+?

好久不见. 提交于 2019-12-01 11:55:08

Since nobody came up with a solution, I'm going to answer my own question.

It seems that there is really no way to achieve what I wanted, at least with the latest Android versions. So I ended up doing the following ugly workaround:

I'm now muting the whole phone (incoming phone calls and notifications) via RINGER_MODE_SILENT but also listen for incoming phone calls via a BroadcastReceiver. As soon as an incoming call is detected, the RingerMode gets reverted to its previous state. This effectively leads to the functionality I wanted to achieve.

I'm, however, extremely unsatisfied with this workaround.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!