Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3e9770b authored by Eric Laurent's avatar Eric Laurent Committed by android-build-team Robot
Browse files

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
(cherry picked from commit 4dc6d002)
parent c9670c55
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;
    }