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

Commit 2d4e170f authored by Mikhail Naganov's avatar Mikhail Naganov
Browse files

audiopolicy: Fix after commit 11d30104

The change ag/5874343 switched to DeviceVector usage instead of
audio_devices_t. In AudioPolicyManager::setOutputDevices, one of
the conditions comparing a device to AUDIO_DEVICE_NONE had been
inverted.

This was resulting in resetting of default patches during
a call to 'setForceUse' function.

Test: audiopolicy_tests
Change-Id: Idc43bc152c3d749cd1dab9b696e7e1e700ef3926
parent e75dca3f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5319,7 +5319,7 @@ uint32_t AudioPolicyManager::setOutputDevices(const sp<SwAudioOutputDescriptor>&
    //  AND force is not specified
    //  AND the output is connected by a valid audio patch.
    // Doing this check here allows the caller to call setOutputDevices() without conditions
    if ((!filteredDevices.isEmpty() || filteredDevices == prevDevices) &&
    if ((filteredDevices.isEmpty() || filteredDevices == prevDevices) &&
            !force && outputDesc->getPatchHandle() != 0) {
        ALOGV("%s setting same device %s or null device, force=%d, patch handle=%d", __func__,
              filteredDevices.toString().c_str(), force, outputDesc->getPatchHandle());