audio policy: fix VoIP audio switching from BT SCO to earpiece
commit 8f2f4e913 fixed b/188020987 but just for Cell calls.
This CL completes the fix for VoIP calls.
Bug: 188752649
Test: Cell and VoIP calls over earpiece and Bluetooth
Change-Id: I6a5563d9e802e664d4824b8f3c19a187529a17d7
diff --git a/services/audiopolicy/enginedefault/src/Engine.cpp b/services/audiopolicy/enginedefault/src/Engine.cpp
index 27a7ac4..ca8e96c 100644
--- a/services/audiopolicy/enginedefault/src/Engine.cpp
+++ b/services/audiopolicy/enginedefault/src/Engine.cpp
@@ -187,8 +187,10 @@
availableOutputDevices = availPrimaryOutputDevices;
}
- // Do not use A2DP devices when in call but use them when not in call
- // (e.g for voice mail playback)
+ }
+ // Do not use A2DP devices when in call but use them when not in call
+ // (e.g for voice mail playback)
+ if (isInCall()) {
availableOutputDevices.remove(availableOutputDevices.getDevicesFromTypes({
AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES,
AUDIO_DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER, }));