Skip to content
Snippets Groups Projects
Commit ef7eec28 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Prevent SecurityException on Android 7+

parent cd1c99ef
No related branches found
No related tags found
No related merge requests found
......@@ -2242,7 +2242,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
}
private void setAudioVolume(int vol) {
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, vol, 0);
if (vol <= 0 && AndroidUtil.isNougatOrLater)
return; //Android N+ throws "SecurityException: Not allowed to change Do Not Disturb state"
/* Since android 4.3, the safe volume warning dialog is displayed only with the FLAG_SHOW_UI flag.
* We don't want to always show the default UI volume, so show it only when volume is not set. */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment