From a4848b96ec1598ce37f6e72b83ee08884869a1e9 Mon Sep 17 00:00:00 2001 From: Simon Shields Date: Wed, 23 Aug 2017 09:45:26 +1000 Subject: 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 --- policy_hal/AudioPolicyManager.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index 28333a92..d6ddaf60 100644 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -718,15 +718,16 @@ void AudioPolicyManagerCustom::setForceUse(audio_policy_force_use_t usage, } } - audio_io_handle_t activeInput = mInputs.getActiveInput(); - if (activeInput != 0) { - sp activeDesc = mInputs.valueFor(activeInput); - audio_devices_t newDevice = getNewInputDevice(activeInput); + Vector> activeInputs = mInputs.getActiveInputs(); + for (size_t i = 0; i < activeInputs.size(); i++) { + sp 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); } } -- cgit v1.2.3