summaryrefslogtreecommitdiff
path: root/libs/audioflinger/AudioPolicyManagerBase.cpp
diff options
context:
space:
mode:
author Jean-Michel Trivi <jmtrivi@google.com> 2010-03-15 14:18:57 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2010-03-15 14:18:57 -0700
commit1a3786a3e34112e3e68e6a9b07ba72802867a002 (patch)
tree93c8c901711c6aff9f8c69bb304fc6e5967e987a /libs/audioflinger/AudioPolicyManagerBase.cpp
parent6af8e145f2e596b28255c202fb4b48f004aa8af2 (diff)
parente4b8c4230128193ebaa93ebddf8378f2ca5b8430 (diff)
Merge "Fix bug 2203203 Route STREAM_VOICE_CALL to A2DP when not in call."
Diffstat (limited to 'libs/audioflinger/AudioPolicyManagerBase.cpp')
-rw-r--r--libs/audioflinger/AudioPolicyManagerBase.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/audioflinger/AudioPolicyManagerBase.cpp b/libs/audioflinger/AudioPolicyManagerBase.cpp
index 2b0a6c8c55f1..a61221a1a353 100644
--- a/libs/audioflinger/AudioPolicyManagerBase.cpp
+++ b/libs/audioflinger/AudioPolicyManagerBase.cpp
@@ -1435,6 +1435,15 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy,
if (device) break;
device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET;
if (device) break;
+#ifdef WITH_A2DP
+ // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to A2DP
+ if (mPhoneState != AudioSystem::MODE_IN_CALL) {
+ device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP;
+ if (device) break;
+ device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_HEADPHONES;
+ if (device) break;
+ }
+#endif
device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_EARPIECE;
if (device == 0) {
LOGE("getDeviceForStrategy() earpiece device not found");
@@ -1446,6 +1455,14 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy,
device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_SCO_CARKIT;
if (device) break;
}
+#ifdef WITH_A2DP
+ // when not in a phone call, phone strategy should route STREAM_VOICE_CALL to
+ // A2DP speaker when forcing to speaker output
+ if (mPhoneState != AudioSystem::MODE_IN_CALL) {
+ device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_BLUETOOTH_A2DP_SPEAKER;
+ if (device) break;
+ }
+#endif
device = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER;
if (device == 0) {
LOGE("getDeviceForStrategy() speaker device not found");