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

Commit f96e5438 authored by François Gaffie's avatar François Gaffie Committed by Eric Laurent
Browse files

audiopolicy: fix routing of exclusive preferred device



In call music played on remote is called an "exclusive" preferred
device. It may not be propagated to other client that may play locally.
The client of the exclusive preferred device is not routed as the
exclusive preferred device are ignored from findPreferredDevice helper.

This CL fixes the routing

Bug: 130284799
Test: AudioPolicyEmulatorTests --gtest_filter=FilteringExpliciRoutingTest*

Change-Id: Iec7e14cb170d0f67c8c0b231f8219c133d7d2185
Signed-off-by: default avatarFrançois Gaffie <francois.gaffie@renault.com>
parent 393f0e05
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1641,7 +1641,14 @@ status_t AudioPolicyManager::startSource(const sp<SwAudioOutputDescriptor>& outp
    outputDesc->setClientActive(client, true);

    if (client->hasPreferredDevice(true)) {
        if (outputDesc->clientsList(true /*activeOnly*/).size() == 1 &&
                client->isPreferredDeviceForExclusiveUse()) {
            // Preferred device may be exclusive, use only if no other active clients on this output
            devices = DeviceVector(
                        mAvailableOutputDevices.getDeviceFromId(client->preferredDeviceId()));
        } else {
            devices = getNewOutputDevices(outputDesc, false /*fromCache*/);
        }
        if (devices != outputDesc->devices()) {
            checkStrategyRoute(clientStrategy, outputDesc->mIoHandle);
        }