Loading android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +2 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,8 @@ final class RemoteDevices { BluetoothDevice device = getDevice(address); if (device == null) { errorLog("aclStateChangeCallback: Device is NULL"); errorLog("aclStateChangeCallback: device is NULL, address=" + Utils.getAddressStringFromByte(address) + ", newState=" + newState); return; } int state = mAdapterService.getState(); Loading android/app/src/com/android/bluetooth/hfp/HeadsetService.java +11 −8 Original line number Diff line number Diff line Loading @@ -352,30 +352,34 @@ public class HeadsetService extends ProfileService { public boolean connect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); Log.d(TAG, "connect: device=" + device); if (getPriority(device) == BluetoothProfile.PRIORITY_OFF) { Log.w(TAG, "connect: PRIORITY_OFF, device=" + device); return false; } int connectionState = mStateMachine.getConnectionState(device); Log.d(TAG, "connectionState = " + connectionState); if (connectionState == BluetoothProfile.STATE_CONNECTED || connectionState == BluetoothProfile.STATE_CONNECTING) { Log.w(TAG, "connect: already connected/connecting, connectionState=" + connectionState + ", device=" + device); return false; } mStateMachine.sendMessage(HeadsetStateMachine.CONNECT, device); return true; } boolean disconnect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); Log.d(TAG, "disconnect: device=" + device); int connectionState = mStateMachine.getConnectionState(device); if (connectionState != BluetoothProfile.STATE_CONNECTED && connectionState != BluetoothProfile.STATE_CONNECTING) { Log.w(TAG, "disconnect: not connected/connecting, connectionState=" + connectionState + ", device=" + device); return false; } mStateMachine.sendMessage(HeadsetStateMachine.DISCONNECT, device); return true; } Loading Loading @@ -483,12 +487,11 @@ public class HeadsetService extends ProfileService { // TODO(BT) BLUETOOTH or BLUETOOTH_ADMIN permission enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); if (!mStateMachine.isConnected()) { return false; } if (!mStateMachine.isSlcConnected()) { Log.w(TAG, "connectAudio: profile not connected"); return false; } if (mStateMachine.isAudioOn()) { Log.w(TAG, "connectAudio: audio is already ON"); return false; } mStateMachine.sendMessage(HeadsetStateMachine.CONNECT_AUDIO); Loading android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +298 −357 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
android/app/src/com/android/bluetooth/btservice/RemoteDevices.java +2 −1 Original line number Diff line number Diff line Loading @@ -513,7 +513,8 @@ final class RemoteDevices { BluetoothDevice device = getDevice(address); if (device == null) { errorLog("aclStateChangeCallback: Device is NULL"); errorLog("aclStateChangeCallback: device is NULL, address=" + Utils.getAddressStringFromByte(address) + ", newState=" + newState); return; } int state = mAdapterService.getState(); Loading
android/app/src/com/android/bluetooth/hfp/HeadsetService.java +11 −8 Original line number Diff line number Diff line Loading @@ -352,30 +352,34 @@ public class HeadsetService extends ProfileService { public boolean connect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); Log.d(TAG, "connect: device=" + device); if (getPriority(device) == BluetoothProfile.PRIORITY_OFF) { Log.w(TAG, "connect: PRIORITY_OFF, device=" + device); return false; } int connectionState = mStateMachine.getConnectionState(device); Log.d(TAG, "connectionState = " + connectionState); if (connectionState == BluetoothProfile.STATE_CONNECTED || connectionState == BluetoothProfile.STATE_CONNECTING) { Log.w(TAG, "connect: already connected/connecting, connectionState=" + connectionState + ", device=" + device); return false; } mStateMachine.sendMessage(HeadsetStateMachine.CONNECT, device); return true; } boolean disconnect(BluetoothDevice device) { enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM, "Need BLUETOOTH ADMIN permission"); Log.d(TAG, "disconnect: device=" + device); int connectionState = mStateMachine.getConnectionState(device); if (connectionState != BluetoothProfile.STATE_CONNECTED && connectionState != BluetoothProfile.STATE_CONNECTING) { Log.w(TAG, "disconnect: not connected/connecting, connectionState=" + connectionState + ", device=" + device); return false; } mStateMachine.sendMessage(HeadsetStateMachine.DISCONNECT, device); return true; } Loading Loading @@ -483,12 +487,11 @@ public class HeadsetService extends ProfileService { // TODO(BT) BLUETOOTH or BLUETOOTH_ADMIN permission enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission"); if (!mStateMachine.isConnected()) { return false; } if (!mStateMachine.isSlcConnected()) { Log.w(TAG, "connectAudio: profile not connected"); return false; } if (mStateMachine.isAudioOn()) { Log.w(TAG, "connectAudio: audio is already ON"); return false; } mStateMachine.sendMessage(HeadsetStateMachine.CONNECT_AUDIO); Loading
android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +298 −357 File changed.Preview size limit exceeded, changes collapsed. Show changes