summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Shields <simon@lineageos.org>2017-08-23 09:45:26 +1000
committerArne Coucheron <arco68@gmail.com>2017-08-25 07:05:47 +0200
commita4848b96ec1598ce37f6e72b83ee08884869a1e9 (patch)
treeaae7ec6cdbb88eae7d272ed543d390facd6f1edf
parent3e9cc572f304719d749afd19ce4f8a1f6a9cf40d (diff)
downloadhardware_qcom_audio-a4848b96ec1598ce37f6e72b83ee08884869a1e9.tar.gz
hardware_qcom_audio-a4848b96ec1598ce37f6e72b83ee08884869a1e9.tar.bz2
hardware_qcom_audio-a4848b96ec1598ce37f6e72b83ee08884869a1e9.zip
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
-rw-r--r--policy_hal/AudioPolicyManager.cpp15
1 files 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<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);
}
}