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

Commit 3afa9b1b authored by Eric Laurent's avatar Eric Laurent
Browse files

audio policy: fix dynamic policy remote submix device removal

The life cycle of an IO profile on remote submix module
associated with a dynamic audio policy is different from other profiles
supporting removable devices with addresses: the profile must not be
cleaned up when the device is disconnected but when the dynamic policy
is unregistered.

Bug: 121200677
Test: phone call while connected to Android auto head unit simulator
Change-Id: I8c9f64697b736dab379a7d85b9d93568139e4e84
parent fc332471
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -398,6 +398,13 @@ void HwModuleCollection::cleanUpForDevice(const sp<DeviceDescriptor> &device)
        if (!moduleDevices.contains(device)) {
            continue;
        }

        // removal of remote submix devices associated with a dynamic policy is
        // handled by removeOutputProfile() and removeInputProfile()
        if (audio_is_remote_submix_device(device->type()) && device->address() != "0") {
            continue;
        }

        device->detach();
        // Only remove from dynamic list, not from declared list!!!
        if (!hwModule->getDynamicDevices().contains(device)) {