summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-05-17 14:11:27 -0700
committerEric Laurent <elaurent@google.com>2013-05-17 14:11:27 -0700
commit66707435156d8d99d795271a7bd54943065b4c2d (patch)
tree43d73b720346c7fe0ec2093f65b06a3c026c5528
parenta776ffd243bbd02948ebefd43f4ac2690ebb11e6 (diff)
downloadlibhardware_legacy-66707435156d8d99d795271a7bd54943065b4c2d.tar.gz
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.cpp4
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);