summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-03-31 17:01:26 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-31 17:01:26 +0000
commit5132e9ceb4c8c8c7e27cabefbad52d9749184912 (patch)
treee8a72db4eca15f1d6c2780d7e4ba662342e88d8c /services/audiopolicy
parentfb7b0f3d27c53096708cea23aa4dc7e829ef36d7 (diff)
parent81e776d00ddf3bfa6c5cf3368418c21bef66262e (diff)
downloadframeworks_av-5132e9ceb4c8c8c7e27cabefbad52d9749184912.zip
frameworks_av-5132e9ceb4c8c8c7e27cabefbad52d9749184912.tar.gz
frameworks_av-5132e9ceb4c8c8c7e27cabefbad52d9749184912.tar.bz2
am 81e776d0: am 2a2642d8: am 42431438: DO NOT MERGE - audio policy: fix DeviceVector::getDevicesFromType()
* commit '81e776d00ddf3bfa6c5cf3368418c21bef66262e': DO NOT MERGE - audio policy: fix DeviceVector::getDevicesFromType()
Diffstat (limited to 'services/audiopolicy')
-rw-r--r--services/audiopolicy/AudioPolicyManager.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp
index 7f27659..6ebd0ed 100644
--- a/services/audiopolicy/AudioPolicyManager.cpp
+++ b/services/audiopolicy/AudioPolicyManager.cpp
@@ -7635,10 +7635,14 @@ AudioPolicyManager::DeviceVector AudioPolicyManager::DeviceVector::getDevicesFro
audio_devices_t type) const
{
DeviceVector devices;
+ bool isOutput = audio_is_output_devices(type);
+ type &= ~AUDIO_DEVICE_BIT_IN;
for (size_t i = 0; (i < size()) && (type != AUDIO_DEVICE_NONE); i++) {
- if (itemAt(i)->mDeviceType & type & ~AUDIO_DEVICE_BIT_IN) {
+ bool curIsOutput = audio_is_output_devices(itemAt(i)->mDeviceType);
+ audio_devices_t curType = itemAt(i)->mDeviceType & ~AUDIO_DEVICE_BIT_IN;
+ if ((isOutput == curIsOutput) && ((type & curType) != 0)) {
devices.add(itemAt(i));
- type &= ~itemAt(i)->mDeviceType;
+ type &= ~curType;
ALOGV("DeviceVector::getDevicesFromType() for type %x found %p",
itemAt(i)->mDeviceType, itemAt(i).get());
}