Merge "Bluetooth: Check state correctly when client wants to bind" am: d77aaf6a6e am: 4e1fe29cf0

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1524638

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I1d0e3a6b8d539e3b26981f3b4080f37ed20a34d9
This commit is contained in:
Treehugger Robot
2020-12-11 20:09:08 +00:00
committed by Automerger Merge Worker

View File

@@ -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");
}