summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-12-22 00:06:36 +0000
committerRicardo Cerqueira <cyanogenmod@cerqueira.org>2012-12-23 11:00:47 +0000
commitf701e0ce201428318691c517de298ef4d71a8d88 (patch)
tree9b732f3a590e8e12dd9bdfca7ba24dff3bcda425
parentc4392efa0270620ac64c967ada82e47d59484f1a (diff)
downloadhardware_libhardware_legacy-f701e0ce201428318691c517de298ef4d71a8d88.tar.gz
hardware_libhardware_legacy-f701e0ce201428318691c517de298ef4d71a8d88.tar.bz2
hardware_libhardware_legacy-f701e0ce201428318691c517de298ef4d71a8d88.zip
audio_policy: Fix volumes for ICS blob compat
Allow usage of the default audio_policy source, even if the primary audio HAL is an ICS binary blob Change-Id: I959a925f458e14380c2e5443b1378c4018d9f084
-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;
}