summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2015-10-15 17:31:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-10-15 17:31:31 +0000
commit0926aab4b8d5d307c95788086090e8d2b2763f1f (patch)
tree8defa17489210dea8527306cfb813bd7400dd777 /services
parent66a581fe1c8bf7546c9e7907612d2b430573dab1 (diff)
parentc171c7c47d099a52ade95c3c8d8907bf09bb88fa (diff)
downloadframeworks_av-0926aab4b8d5d307c95788086090e8d2b2763f1f.zip
frameworks_av-0926aab4b8d5d307c95788086090e8d2b2763f1f.tar.gz
frameworks_av-0926aab4b8d5d307c95788086090e8d2b2763f1f.tar.bz2
Merge "audio policy: fix USB mic selection for VoIP" into mnc-dr-dev
Diffstat (limited to 'services')
-rw-r--r--services/audiopolicy/managerdefault/AudioPolicyManager.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 8419ed5..aa4486d 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -566,9 +566,15 @@ void AudioPolicyManager::setForceUse(audio_policy_force_use_t usage,
audio_io_handle_t activeInput = mInputs.getActiveInput();
if (activeInput != 0) {
- setInputDevice(activeInput, getNewInputDevice(activeInput));
+ sp<AudioInputDescriptor> activeDesc = mInputs.valueFor(activeInput);
+ audio_devices_t newDevice = getNewInputDevice(activeInput);
+ // Force new input selection if the new device can not be reached via current input
+ if (activeDesc->mProfile->mSupportedDevices.types() & (newDevice & ~AUDIO_DEVICE_BIT_IN)) {
+ setInputDevice(activeInput, newDevice);
+ } else {
+ closeInput(activeInput);
+ }
}
-
}
void AudioPolicyManager::setSystemProperty(const char* property, const char* value)