audio policy: fix a2dp output detection

The logic in IOProfile::devicesSupportEncodedFormats()
was only checking if the first device in the list of supported devices
was supporting currently selected A2DP encoding format.
But if more than one devices match the queried types, we need to check
all devices in case one of them supports the selected encoding format.

Bug: 147789166
Test: repro steps in the bug.
Change-Id: I704c5c6278eed524f15e7b73cec68a24f04d3a8c
gugelfrei
Eric Laurent 4 years ago
parent a199662c6a
commit 4dc6d002af

@ -135,8 +135,10 @@ public:
}
DeviceVector deviceList =
mSupportedDevices.getDevicesFromTypes(deviceTypes);
if (!deviceList.empty()) {
return deviceList.itemAt(0)->hasCurrentEncodedFormat();
for (const auto& device : deviceList) {
if (device->hasCurrentEncodedFormat()) {
return true;
}
}
return false;
}

Loading…
Cancel
Save