summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Shields <simon@lineageos.org>2017-08-23 09:45:26 +1000
committerArne Coucheron <arco68@gmail.com>2019-09-28 00:23:56 +0200
commit71578d83571d7169ebaf8fc66283ea475b131f7d (patch)
tree9ee725f69cb2d9e6216ddaf66b2483e0b233620b
parent92041d2a8be28cf35ae84b8d07f7cea2d293e943 (diff)
downloadhardware_qcom_audio-71578d83571d7169ebaf8fc66283ea475b131f7d.tar.gz
hardware_qcom_audio-71578d83571d7169ebaf8fc66283ea475b131f7d.tar.bz2
hardware_qcom_audio-71578d83571d7169ebaf8fc66283ea475b131f7d.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);
}
}