audio policy: fix call audio over 24 bit USB device
Take into account voice RX source device properties when
configuring the audio patch bridging the voice RX device
to the USB output device.
Bug: 25643110
Change-Id: I06f282d3cc12493f21500bf9ab35a3ceb93f14af
diff --git a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
index 07c470d..fe2f9a6 100644
--- a/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
+++ b/services/audiopolicy/managerdefault/AudioPolicyManager.cpp
@@ -309,9 +309,6 @@
void AudioPolicyManager::updateCallRouting(audio_devices_t rxDevice, int delayMs)
{
bool createTxPatch = false;
- struct audio_patch patch;
- patch.num_sources = 1;
- patch.num_sinks = 1;
status_t status;
audio_patch_handle_t afPatchHandle;
DeviceVector deviceList;
@@ -344,8 +341,11 @@
== AUDIO_DEVICE_NONE) {
createTxPatch = true;
}
- } else {
- // create RX path audio patch
+ } else { // create RX path audio patch
+ struct audio_patch patch;
+
+ patch.num_sources = 1;
+ patch.num_sinks = 1;
deviceList = mAvailableOutputDevices.getDevicesFromType(rxDevice);
ALOG_ASSERT(!deviceList.isEmpty(),
"updateCallRouting() selected device not in output device list");
@@ -384,9 +384,9 @@
}
createTxPatch = true;
}
- if (createTxPatch) {
-
+ if (createTxPatch) { // create TX path audio patch
struct audio_patch patch;
+
patch.num_sources = 1;
patch.num_sinks = 1;
deviceList = mAvailableInputDevices.getDevicesFromType(txDevice);