summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-12-23 03:01:06 -0800
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-12-23 03:01:06 -0800
commit3c16e23e9d4b552c197d37e111e657f6baf3653a (patch)
tree6fd45667e7e7cf68b873e5cf0fe383821b24e7d6
parent4db603d7d6610145e5e782a7051dc668a8acfc88 (diff)
parentf701e0ce201428318691c517de298ef4d71a8d88 (diff)
downloadhardware_libhardware_legacy-3c16e23e9d4b552c197d37e111e657f6baf3653a.tar.gz
hardware_libhardware_legacy-3c16e23e9d4b552c197d37e111e657f6baf3653a.tar.bz2
hardware_libhardware_legacy-3c16e23e9d4b552c197d37e111e657f6baf3653a.zip
Merge "audio_policy: Fix volumes for ICS blob compat" into cm-10.1
-rw-r--r--audio/AudioPolicyManagerBase.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp
index b4f4778..cb9afa6 100644
--- a/audio/AudioPolicyManagerBase.cpp
+++ b/audio/AudioPolicyManagerBase.cpp
@@ -1008,7 +1008,10 @@ status_t AudioPolicyManagerBase::setStreamVolumeIndex(AudioSystem::stream_type s
for (size_t i = 0; i < mOutputs.size(); i++) {
audio_devices_t curDevice =
getDeviceForVolume(mOutputs.valueAt(i)->device());
- if (device == curDevice) {
+#ifndef ICS_AUDIO_BLOB
+ if (device == curDevice)
+#endif
+ {
status_t volStatus = checkAndSetVolume(stream, index, mOutputs.keyAt(i), curDevice);
if (volStatus != NO_ERROR) {
status = volStatus;
@@ -1025,6 +1028,7 @@ status_t AudioPolicyManagerBase::getStreamVolumeIndex(AudioSystem::stream_type s
if (index == NULL) {
return BAD_VALUE;
}
+#ifndef ICS_AUDIO_BLOB
if (!audio_is_output_device(device)) {
return BAD_VALUE;
}
@@ -1036,6 +1040,9 @@ status_t AudioPolicyManagerBase::getStreamVolumeIndex(AudioSystem::stream_type s
device = getDeviceForVolume(device);
*index = mStreams[stream].getVolumeIndex(device);
+#else
+ *index = mStreams[stream].mIndexCur.valueAt(0);
+#endif
ALOGV("getStreamVolumeIndex() stream %d device %08x index %d", stream, device, *index);
return NO_ERROR;
}