Skip to content

Commit 0c73e5b

Browse files
TreeHugger RobotAndroid (Google) Code Review
authored andcommitted
Merge "Bluetooth: Check state correctly when client wants to bind" into rvc-qpr-dev
2 parents 6403bb4 + 3734966 commit 0c73e5b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

services/core/java/com/android/server/BluetoothManagerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ public IBluetoothGatt getBluetoothGatt() {
12361236
@Override
12371237
public boolean bindBluetoothProfileService(int bluetoothProfile,
12381238
IBluetoothProfileServiceConnection proxy) {
1239-
if (!mEnable) {
1239+
if (mState != BluetoothAdapter.STATE_ON) {
12401240
if (DBG) {
12411241
Slog.d(TAG, "Trying to bind to profile: " + bluetoothProfile
12421242
+ ", while Bluetooth was disabled");
@@ -1400,7 +1400,7 @@ private boolean bindService() {
14001400
mBluetoothLock.readLock().unlock();
14011401
}
14021402

1403-
if (!mEnable || state != BluetoothAdapter.STATE_ON) {
1403+
if (state != BluetoothAdapter.STATE_ON) {
14041404
if (DBG) {
14051405
Slog.d(TAG, "Unable to bindService while Bluetooth is disabled");
14061406
}

0 commit comments

Comments
 (0)