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

Commit da367c1b authored by Anurag Awasthi's avatar Anurag Awasthi Committed by Automerger Merge Worker
Browse files

Merge "Log more reasons for possible HFP failure" into main am: 78686c7a

parents c2517aee 78686c7a
Loading
Loading
Loading
Loading
+14 −1
Original line number Original line Diff line number Diff line
@@ -17,7 +17,6 @@
package com.android.bluetooth.hfp;
package com.android.bluetooth.hfp;


import static android.Manifest.permission.BLUETOOTH_CONNECT;
import static android.Manifest.permission.BLUETOOTH_CONNECT;

import static com.android.modules.utils.build.SdkLevel.isAtLeastU;
import static com.android.modules.utils.build.SdkLevel.isAtLeastU;


import android.annotation.RequiresPermission;
import android.annotation.RequiresPermission;
@@ -514,6 +513,13 @@ public class HeadsetStateMachine extends StateMachine {
                                device,
                                device,
                                BluetoothProfile.STATE_DISCONNECTED,
                                BluetoothProfile.STATE_DISCONNECTED,
                                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;
                        break;
                    }
                    }
                    transitionTo(mConnecting);
                    transitionTo(mConnecting);
@@ -575,6 +581,13 @@ public class HeadsetStateMachine extends StateMachine {
                        // Indicate rejection to other components.
                        // Indicate rejection to other components.
                        broadcastConnectionState(mDevice, BluetoothProfile.STATE_DISCONNECTED,
                        broadcastConnectionState(mDevice, BluetoothProfile.STATE_DISCONNECTED,
                                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;
                    break;
                case HeadsetHalConstants.CONNECTION_STATE_DISCONNECTING:
                case HeadsetHalConstants.CONNECTION_STATE_DISCONNECTING: