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

Commit d1519090 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "audio policy: fix remote submix input sharing" into main

parents d7fbd841 35a55961
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -3199,8 +3199,10 @@ audio_io_handle_t AudioPolicyManager::getInputForDevice(const sp<DeviceDescripto
        return input;
    }

    // Reuse an already opened input if a client with the same session ID already exists
    // on that input
    // Reuse an already opened input if:
    //  - a client with the same session ID already exists on that input
    //  - OR the requested device is a remote submix device with the same adrress
    //    as the one connected to that input
    for (size_t i = 0; i < mInputs.size(); i++) {
        sp <AudioInputDescriptor> desc = mInputs.valueAt(i);
        if (desc->mProfile != profile) {
@@ -3212,6 +3214,11 @@ audio_io_handle_t AudioPolicyManager::getInputForDevice(const sp<DeviceDescripto
                return desc->mIoHandle;
            }
        }
        if (audio_is_remote_submix_device(device->type())
                && (device->address() != "0")
                && device->equals(desc->getDevice())) {
            return desc->mIoHandle;
        }
    }

    bool isPreemptor = false;