Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 545ab973 authored by Anurag Awasthi's avatar Anurag Awasthi
Browse files

Log more reasons for possible HFP failure

Test: m followed by manual testing done for triggering failures

Bug: 299292200
Change-Id: Id542f6e0571bea29a367472201a9d9874cde19a8
parent 5da20d02
Loading
Loading
Loading
Loading
+14 −1
Original line number Diff line number Diff line
@@ -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: