summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Anurag Awasthi <anuragaw@google.com> 2023-09-06 16:31:19 +0000
committer Anurag Awasthi <anuragaw@google.com> 2023-09-08 15:08:11 +0000
commit545ab97324f8798c9e191fe3f1483f997560b4d3 (patch)
tree5adf471cd97f7bd3988254513107f024ac8804e8
parent5da20d0263ad6792539809983742b31ada23fc4b (diff)
Log more reasons for possible HFP failure
Test: m followed by manual testing done for triggering failures Bug: 299292200 Change-Id: Id542f6e0571bea29a367472201a9d9874cde19a8
-rw-r--r--android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
index e6256389cc..519ba33f9c 100644
--- a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
+++ b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java
@@ -17,7 +17,6 @@
package com.android.bluetooth.hfp;
import static android.Manifest.permission.BLUETOOTH_CONNECT;
-
import static com.android.modules.utils.build.SdkLevel.isAtLeastU;
import android.annotation.RequiresPermission;
@@ -514,6 +513,13 @@ public class HeadsetStateMachine extends StateMachine {
device,
BluetoothProfile.STATE_DISCONNECTED,
BluetoothProfile.STATE_DISCONNECTED);
+ BluetoothStatsLog.write(
+ BluetoothStatsLog.BLUETOOTH_PROFILE_CONNECTION_ATTEMPTED,
+ BluetoothProfile.HEADSET,
+ BluetoothProtoEnums.RESULT_FAILURE,
+ BluetoothProfile.STATE_DISCONNECTED,
+ BluetoothProfile.STATE_DISCONNECTED,
+ BluetoothProtoEnums.REASON_NATIVE_LAYER_REJECTED);
break;
}
transitionTo(mConnecting);
@@ -575,6 +581,13 @@ public class HeadsetStateMachine extends StateMachine {
// Indicate rejection to other components.
broadcastConnectionState(mDevice, BluetoothProfile.STATE_DISCONNECTED,
BluetoothProfile.STATE_DISCONNECTED);
+ BluetoothStatsLog.write(
+ BluetoothStatsLog.BLUETOOTH_PROFILE_CONNECTION_ATTEMPTED,
+ BluetoothProfile.HEADSET,
+ BluetoothProtoEnums.RESULT_FAILURE,
+ BluetoothProfile.STATE_DISCONNECTED,
+ BluetoothProfile.STATE_DISCONNECTED,
+ BluetoothProtoEnums.REASON_INCOMING_CONN_REJECTED);
}
break;
case HeadsetHalConstants.CONNECTION_STATE_DISCONNECTING: