summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-03-30 16:38:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-30 16:38:05 +0000
commit46bd6b5bb8f1dfd26977a04ee6fcf9641321ca29 (patch)
treee694ef16af909dcfd1fb9a1e0efbd01ef9b26ef8 /services
parent9bb23ff63e17b91a8480b142975067e8b6ab69ec (diff)
parent4c91f90c72e74474fad7f6a99ae7926c8d1f2504 (diff)
downloadframeworks_av-46bd6b5bb8f1dfd26977a04ee6fcf9641321ca29.zip
frameworks_av-46bd6b5bb8f1dfd26977a04ee6fcf9641321ca29.tar.gz
frameworks_av-46bd6b5bb8f1dfd26977a04ee6fcf9641321ca29.tar.bz2
Merge "audio policy: fix DeviceVector::getDevicesFromType()"
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/managerdefault/Devices.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/audiopolicy/managerdefault/Devices.cpp b/services/audiopolicy/managerdefault/Devices.cpp
index 13c8bbc..42e198c 100644
--- a/services/audiopolicy/managerdefault/Devices.cpp
+++ b/services/audiopolicy/managerdefault/Devices.cpp
@@ -180,10 +180,14 @@ sp<DeviceDescriptor> DeviceVector::getDeviceFromId(audio_port_handle_t id) const
DeviceVector DeviceVector::getDevicesFromType(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());
}