项目前提:不支持听筒和线控耳机
步骤:
蓝牙耳机连接工作状态下接通电话 - 音频路径(此时为蓝牙) - 切换至免提
现象:
切换免提失败,UI显示切换至听筒
提case给高通,回复让我打个patch:
please merge CR#2477458 patch and test again.
Subject: [PATCH] Change bluetooth routing to be more responsive
Rely on the BT stack's audio-off message to transition into the
audio-off state.
Bug: 115319793
CRs-Fixed: 2477458
---
diff --git a/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java b/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java
index 516c8bd..6ad7c9b 100644
--- a/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java
+++ b/src/com/android/server/telecom/bluetooth/BluetoothRouteManager.java
@@ -123,7 +123,7 @@
BluetoothDevice erroneouslyConnectedDevice = getBluetoothAudioConnectedDevice();
if (erroneouslyConnectedDevice != null) {
Log.w(LOG_TAG, "Entering AudioOff state but device %s appears to be connected. " +
- "Switching to audio-on state for that device", erroneouslyConnectedDevice);
+ "Switching to audio-on state for that device.", erroneouslyConnectedDevice);
// change this to just transition to the new audio on state
transitionToActualState();
}
@@ -262,7 +262,6 @@
break;
case DISCONNECT_HFP:
disconnectAudio();
- transitionTo(mAudioOffState);
break;
case RETRY_HFP_CONNECTION:
if (Objects.equals(address, mDeviceAddress)) {
@@ -375,7 +374,6 @@
break;
case DISCONNECT_HFP:
disconnectAudio();
- transitionTo(mAudioOffState);
break;
case RETRY_HFP_CONNECTION:
if (Objects.equals(address, mDeviceAddress)) {
成功切换了,记录一下。