diff options
author | Eric Laurent <elaurent@google.com> | 2013-05-17 14:11:27 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2013-05-17 14:11:27 -0700 |
commit | 66707435156d8d99d795271a7bd54943065b4c2d (patch) | |
tree | 43d73b720346c7fe0ec2093f65b06a3c026c5528 | |
parent | a776ffd243bbd02948ebefd43f4ac2690ebb11e6 (diff) | |
download | libhardware_legacy-66707435156d8d99d795271a7bd54943065b4c2d.tar.gz |
audio policy: fix device selection in startInput()android-4.3_r2android-4.3_r1.1android-4.3_r1android-4.3_r0.9.1android-4.3_r0.9jb-mr2-release
Check again input device selection when capture starts in case
conditions have changed since the input stream was opened.
This is related to but does not fix issue 8761558. It makes the
selection of BT SCO device consistent.
Bug: 8761558
Change-Id: I386b638e9c3238711e16fb848449af561624359e
-rw-r--r-- | audio/AudioPolicyManagerBase.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/audio/AudioPolicyManagerBase.cpp b/audio/AudioPolicyManagerBase.cpp index e755d28..236bf69 100644 --- a/audio/AudioPolicyManagerBase.cpp +++ b/audio/AudioPolicyManagerBase.cpp @@ -941,6 +941,10 @@ status_t AudioPolicyManagerBase::startInput(audio_io_handle_t input) } } + audio_devices_t newDevice = getDeviceForInputSource(inputDesc->mInputSource); + if ((newDevice != AUDIO_DEVICE_NONE) && (newDevice != inputDesc->mDevice)) { + inputDesc->mDevice = newDevice; + } AudioParameter param = AudioParameter(); param.addInt(String8(AudioParameter::keyRouting), (int)inputDesc->mDevice); |