huhx0015 / HXAudioPlayer

HX Audio Player: A custom audio wrapper library for Android 2.3 and above. Originally designed as an audio library for games, HX Audio Player is an easy-to-use, alternative approach to implementing music and sound playback into Android applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Android 7.0+: HXGSEPhysicalSound::disablePhysSounds() Security Exception

huhx0015 opened this issue · comments

Starting from API 24, accessing the AudioManager.adjustStreamVolume() causes the following security exception:

java.lang.SecurityException: Not allowed to change Do Not Disturb state

With the Do Not Disturb feature, the permission android.permission.ACCESS_NOTIFICATION_POLICY is required to adjust the stream volume. As a result, this method has been disabled for Android 7.0 and above for now.

Related Link: http://stackoverflow.com/questions/39151453/in-android-7-api-level-24-my-app-is-not-allowed-to-mute-phone-set-ringer-mode