summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristine Hallstrom <hallstrom@google.com>2016-10-27 13:14:08 -0700
committerChristine Hallstrom <hallstrom@google.com>2016-10-28 10:46:29 -0700
commit3ee63fdfb7fa5896bff7e172be60c763919c9f63 (patch)
tree0b4d1cb80ef7f73f942218654c24ddcb2dbd7463
parent283c7ead04930b5d54837ba55835aa8c07b9b966 (diff)
downloadandroid_packages_apps_Bluetooth-3ee63fdfb7fa5896bff7e172be60c763919c9f63.tar.gz
android_packages_apps_Bluetooth-3ee63fdfb7fa5896bff7e172be60c763919c9f63.tar.bz2
android_packages_apps_Bluetooth-3ee63fdfb7fa5896bff7e172be60c763919c9f63.zip
Disable HFP audio path when HFP call goes on hold/resume when goes off hold
This fixes the issue where a cellular call made to a watch when an HFP call is in progress causes the cellular audio to go through the HFP path. Bug: 32164561 Change-Id: I179ba4e1f1a1e76496f3062cc29bc20014fe5661
-rwxr-xr-xsrc/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
index d3f2dfabb..05f3cae19 100755
--- a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
+++ b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
@@ -993,6 +993,14 @@ final class HeadsetClientStateMachine extends StateMachine {
return;
}
+ if (flag == BluetoothHeadsetClient.CALL_ACCEPT_HOLD) {
+ // HFP is disabled when a call is put on hold to ensure correct audio routing for
+ // cellular calls accepted while an HFP call is in progress. Reenable HFP when the HFP
+ // call is put off hold.
+ Log.d(TAG,"hfp_enable=true");
+ mAudioManager.setParameters("hfp_enable=true");
+ }
+
if (handleCallActionNative(action, 0)) {
addQueuedAction(ACCEPT_CALL, action);
} else {
@@ -1056,6 +1064,11 @@ final class HeadsetClientStateMachine extends StateMachine {
action = HeadsetClientHalConstants.CALL_ACTION_CHLD_2;
}
+ // Set HFP enable to false in case the call is being held to accept a cellular call. This
+ // allows the cellular call's audio to be correctly routed.
+ Log.d(TAG,"hfp_enable=false");
+ mAudioManager.setParameters("hfp_enable=false");
+
if (handleCallActionNative(action, 0)) {
addQueuedAction(HOLD_CALL, action);
} else {