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

Commit 270b6e98 authored by Wei Liu's avatar Wei Liu
Browse files

Add some debug logs to the HeadsetClientService.

b/31976064

Change-Id: I13602fbe6ef45f039a15d36ea0d1ac3802a9fddd
parent 434af06a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -166,6 +166,8 @@ public class HeadsetClientService extends ProfileService {
            if (mService != null && mService.isAvailable()) {
                return mService;
            }

            Log.e(TAG, "HeadsetClientService is not available.");
            return null;
        }

@@ -484,12 +486,14 @@ public class HeadsetClientService extends ProfileService {
                "Need BLUETOOTH ADMIN permission");

        if (getPriority(device) == BluetoothProfile.PRIORITY_OFF) {
            Log.w(TAG, "Connection not allowed: <" + device.getAddress() + "> is PRIORITY_OFF");
            return false;
        }

        int connectionState = mStateMachine.getConnectionState(device);
        if (connectionState == BluetoothProfile.STATE_CONNECTED ||
                connectionState == BluetoothProfile.STATE_CONNECTING) {
            Log.w(TAG, "Unable to connect: state is CONNECTING or CONNECTED.");
            return false;
        }