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

Commit 498d2151 authored by jiabin's avatar jiabin
Browse files

No need to reopen output when the active media devices is empty.

The active media devices will be used to reopen outputs to use the best
profile. When the active media devices is empty, there is no need to
reopen the outputs.

Bug: 183980515
Test: connect/disconnect BT device
Change-Id: I483bb001d6e196bf448d039230cc36a5b4cdbdfe
parent dfca1ce8
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -284,7 +284,7 @@ status_t AudioPolicyManager::setDeviceConnectionStateInt(const sp<DeviceDescript
                setOutputDevices(desc, newDevices, force, 0);
            }
            if (!desc->isDuplicated() && desc->mProfile->hasDynamicAudioProfile() &&
                    desc->devices() != activeMediaDevices &&
                    !activeMediaDevices.empty() && desc->devices() != activeMediaDevices &&
                    desc->supportsDevicesForPlayback(activeMediaDevices)) {
                // Reopen the output to query the dynamic profiles when there is not active
                // clients or all active clients will be rerouted. Otherwise, set the flag