Skip to content

Commit

Permalink
AudioService: Show safe volume panel for non-interactive volume adjus…
Browse files Browse the repository at this point in the history
…tments

If safe volume is active, apps calling mp.setVolume() to adjust the
headset to a value higher than the threshold will have the operation
fail silently because no volume dialog is active to pop up the
"do you wish to override" question.
This is particularly bad for peripherals that use the audio jack
(Square readers, Jawbone bands), since they usually require levels
close to maximum for proper communication and the app isn't prepared
to deal with a silent rejection of the requested volume.

Change-Id: I2047d199506106a87841b8b680007c5ab45b527b
  • Loading branch information
rmcc committed Jul 16, 2014
1 parent e950ce1 commit 30e1bce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion media/java/android/media/AudioService.java
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ public void setStreamVolume(int streamType, int index, int flags, String calling
}

if (!checkSafeMediaVolume(streamTypeAlias, index, device)) {
mVolumePanel.postDisplaySafeVolumeWarning(flags);
mVolumePanel.postDisplaySafeVolumeWarning(flags | AudioManager.FLAG_SHOW_UI);
mPendingVolumeCommand = new StreamVolumeCommand(
streamType, index, flags, device);
} else {
Expand Down

0 comments on commit 30e1bce

Please sign in to comment.