diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2020-12-11 19:13:44 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-12-11 19:13:44 +0000 |
commit | d77aaf6a6e5cd51568f707571a45a6c7b91ddadb (patch) | |
tree | dd8f8b9c17a04e508a49c464182950085079d449 | |
parent | 2e8693718cf76d032812d4934336a1a64779c439 (diff) | |
parent | 73802a1802f9c1fa6b14684ed124cce904aee7c0 (diff) |
Merge "Bluetooth: Check state correctly when client wants to bind"
-rw-r--r-- | services/core/java/com/android/server/BluetoothManagerService.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/BluetoothManagerService.java b/services/core/java/com/android/server/BluetoothManagerService.java index 0b8b3526400a..aab05532e2b7 100644 --- a/services/core/java/com/android/server/BluetoothManagerService.java +++ b/services/core/java/com/android/server/BluetoothManagerService.java @@ -1265,7 +1265,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { @Override public boolean bindBluetoothProfileService(int bluetoothProfile, IBluetoothProfileServiceConnection proxy) { - if (!mEnable) { + if (mState != BluetoothAdapter.STATE_ON) { if (DBG) { Slog.d(TAG, "Trying to bind to profile: " + bluetoothProfile + ", while Bluetooth was disabled"); @@ -1431,7 +1431,7 @@ class BluetoothManagerService extends IBluetoothManager.Stub { mBluetoothLock.readLock().unlock(); } - if (!mEnable || state != BluetoothAdapter.STATE_ON) { + if (state != BluetoothAdapter.STATE_ON) { if (DBG) { Slog.d(TAG, "Unable to bindService while Bluetooth is disabled"); } |