diff options
author | Eric Laurent <elaurent@google.com> | 2012-09-25 14:33:56 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-10-03 10:17:10 -0700 |
commit | 799448bee167c046ed715c7c4e3fe3486bf80d43 (patch) | |
tree | 61678b8fb57460a757ce88fff12a354813cf8893 /media/java | |
parent | 57e6203457cedbc6f4bf8a45635862a3eb717e9f (diff) | |
download | frameworks_base-799448bee167c046ed715c7c4e3fe3486bf80d43.zip frameworks_base-799448bee167c046ed715c7c4e3fe3486bf80d43.tar.gz frameworks_base-799448bee167c046ed715c7c4e3fe3486bf80d43.tar.bz2 |
AudioService: filter flags in volume methods
Strip FIXED_VOLUME flag in setStreamVolume() and
adjustStreamVolume() as this flag is reserved for
framework use.
Bug 4335692.
Change-Id: I507582270f4c4cd631ee81fe50dca895bb6352b3
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index fdb6818..d05c6de 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -733,7 +733,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { if (streamType == STREAM_REMOTE_MUSIC) { // don't play sounds for remote - flags &= ~AudioManager.FLAG_PLAY_SOUND; + flags &= ~(AudioManager.FLAG_PLAY_SOUND|AudioManager.FLAG_FIXED_VOLUME); //if (DEBUG_VOL) Log.i(TAG, "Need to adjust remote volume: calling adjustRemoteVolume()"); adjustRemoteVolume(AudioSystem.STREAM_MUSIC, direction, flags); } else { @@ -771,6 +771,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { int index; int oldIndex; + flags &= ~AudioManager.FLAG_FIXED_VOLUME; if ((streamTypeAlias == AudioSystem.STREAM_MUSIC) && ((device & mFixedVolumeDevices) != 0)) { flags |= AudioManager.FLAG_FIXED_VOLUME; @@ -855,6 +856,7 @@ public class AudioService extends IAudioService.Stub implements OnFinished { final int device = getDeviceForStream(streamType); int oldIndex; + flags &= ~AudioManager.FLAG_FIXED_VOLUME; if ((mStreamVolumeAlias[streamType] == AudioSystem.STREAM_MUSIC) && ((device & mFixedVolumeDevices) != 0)) { flags |= AudioManager.FLAG_FIXED_VOLUME; |