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

Commit 2056ec73 authored by Simon Shields's avatar Simon Shields Committed by Ashwin Ramesh
Browse files

policy_hal: fix build with concurrent audio capture

This brings the policy HAL in line with fw/av commit
4b2fcd8abf90b1bd95539f9f4ef2ac39ce9e2df1 ("audio policy
for concurrent capture")

Change-Id: I52777565da44b57e2c67066e060e2ee64f8e4cfa
parent 8706befa
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -771,15 +771,16 @@ void AudioPolicyManagerCustom::setForceUse(audio_policy_force_use_t usage,
        }
    }

    audio_io_handle_t activeInput = mInputs.getActiveInput();
    if (activeInput != 0) {
        sp<AudioInputDescriptor> activeDesc = mInputs.valueFor(activeInput);
        audio_devices_t newDevice = getNewInputDevice(activeInput);
    Vector<sp <AudioInputDescriptor>> activeInputs = mInputs.getActiveInputs();
    for (size_t i = 0; i < activeInputs.size(); i++) {
        sp<AudioInputDescriptor> activeDesc = activeInputs[i];
        audio_devices_t newDevice = getNewInputDevice(activeDesc);
        // Force new input selection if the new device can not be reached via current input
        if (activeDesc->mProfile->getSupportedDevices().types() & (newDevice & ~AUDIO_DEVICE_BIT_IN)) {
            setInputDevice(activeInput, newDevice);
        if (activeDesc->mProfile->getSupportedDevices().types()
                & (newDevice & ~AUDIO_DEVICE_BIT_IN)) {
            setInputDevice(activeDesc->mIoHandle, newDevice);
        } else {
            closeInput(activeInput);
            closeInput(activeDesc->mIoHandle);
        }
    }