From cd71a69d922eab2929faf8f5652fcd1b9a29cbe8 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Tue, 16 Dec 2014 12:01:12 -0800 Subject: audio: Force audio to Speaker if requested during VOIP call getDeviceForStrategy is returning AUDIO_DEVICE_OUT_USB even when setForceUse is called with Speaker during VOIP call. Actual Intention is to route audio for phone strategy to USB device even after setForceUse is called with Speaker when not in voice call. It is supposed to exclude VOIP call too Added additional check for MODE_IN_COMMUNICATION so that it returns SPEAKER when setForceUse is called with speaker Bug: 18758599 Change-Id: I1c51128cc1c7bfce1cf6f1fde60b428d3a9379fc --- services/audiopolicy/AudioPolicyManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'services/audiopolicy') diff --git a/services/audiopolicy/AudioPolicyManager.cpp b/services/audiopolicy/AudioPolicyManager.cpp index 744556d..d2b0bcb 100644 --- a/services/audiopolicy/AudioPolicyManager.cpp +++ b/services/audiopolicy/AudioPolicyManager.cpp @@ -4566,7 +4566,7 @@ audio_devices_t AudioPolicyManager::getDeviceForStrategy(routing_strategy strate device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER; if (device) break; } - if (mPhoneState != AUDIO_MODE_IN_CALL) { + if (!isInCall()) { device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_ACCESSORY; if (device) break; device = availableOutputDeviceTypes & AUDIO_DEVICE_OUT_USB_DEVICE; -- cgit v1.1