Commit b22311ca authored by Thomas Guillem's avatar Thomas Guillem
Browse files

Fix safe volume dialog not displayed when increasing audio volume

parent d1021fff
......@@ -1623,6 +1623,13 @@ public class VideoPlayerActivity extends ActionBarActivity implements IVideoPlay
private void setAudioVolume(int vol) {
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, vol, 0);
/* 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. */
int newVol = mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
if (vol != newVol)
mAudioManager.setStreamVolume(AudioManager.STREAM_MUSIC, vol, AudioManager.FLAG_SHOW_UI);
mTouchAction = TOUCH_VOLUME;
showInfo(getString(R.string.volume) + '\u00A0' + Integer.toString(vol),1000);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment