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

Commit 11c499a5 authored by Haynes Mathew George's avatar Haynes Mathew George Committed by Glenn Kasten
Browse files

audiopolicy: Avoid spurious routing in APM::stopSource

On AudioOutput::stopSource, ignore routing calls
on an output descriptor to the same device

Bug: 31185954
Change-Id: I80f442982f7e66efb59b639a7ca9424745dbd70a
parent 8e7b58c0
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1321,9 +1321,11 @@ status_t AudioPolicyManager::stopSource(sp<AudioOutputDescriptor> outputDesc,
                        desc->isActive() &&
                        outputDesc->sharesHwModuleWith(desc) &&
                        (newDevice != desc->device())) {
                    audio_devices_t newDevice2 = getNewOutputDevice(desc, false /*fromCache*/);
                    bool force = desc->device() != newDevice2;
                    setOutputDevice(desc,
                                    getNewOutputDevice(desc, false /*fromCache*/),
                                    true,
                                    newDevice2,
                                    force,
                                    outputDesc->latency()*2);
                }
            }