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