Skip to content

Commit 31fed73

Browse files
Eric LaurentAndroid (Google) Code Review
authored andcommitted
Merge "AudioService: filter flags in volume methods" into jb-mr1-dev
2 parents 6295ef3 + 799448b commit 31fed73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

media/java/android/media/AudioService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ public void adjustSuggestedStreamVolume(int direction, int suggestedStreamType,
733733

734734
if (streamType == STREAM_REMOTE_MUSIC) {
735735
// don't play sounds for remote
736-
flags &= ~AudioManager.FLAG_PLAY_SOUND;
736+
flags &= ~(AudioManager.FLAG_PLAY_SOUND|AudioManager.FLAG_FIXED_VOLUME);
737737
//if (DEBUG_VOL) Log.i(TAG, "Need to adjust remote volume: calling adjustRemoteVolume()");
738738
adjustRemoteVolume(AudioSystem.STREAM_MUSIC, direction, flags);
739739
} else {
@@ -771,6 +771,7 @@ public void adjustStreamVolume(int streamType, int direction, int flags) {
771771
int index;
772772
int oldIndex;
773773

774+
flags &= ~AudioManager.FLAG_FIXED_VOLUME;
774775
if ((streamTypeAlias == AudioSystem.STREAM_MUSIC) &&
775776
((device & mFixedVolumeDevices) != 0)) {
776777
flags |= AudioManager.FLAG_FIXED_VOLUME;
@@ -855,6 +856,7 @@ public void setStreamVolume(int streamType, int index, int flags) {
855856
final int device = getDeviceForStream(streamType);
856857
int oldIndex;
857858

859+
flags &= ~AudioManager.FLAG_FIXED_VOLUME;
858860
if ((mStreamVolumeAlias[streamType] == AudioSystem.STREAM_MUSIC) &&
859861
((device & mFixedVolumeDevices) != 0)) {
860862
flags |= AudioManager.FLAG_FIXED_VOLUME;

0 commit comments

Comments
 (0)