Merge "Global settings for Bluetooth (Settings.Global.BLUETOOTH_ON) must be set to BLUETOOTH_ON_BLUETOOTH whenever non-BLE MESSAGE_ENABLE is handled irrespective of the state." am: 28c8ad15b6 am: 19703c51c1

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

Change-Id: I8ae349015b6829c5f0830c6f371b7ad022f783e7
This commit is contained in:
Treehugger Robot
2021-12-24 06:51:41 +00:00
committed by Automerger Merge Worker

View File

@@ -1850,6 +1850,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
mHandler.removeMessages(MESSAGE_RESTART_BLUETOOTH_SERVICE);
mEnable = true;
if (isBle == 0) {
persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
}
// Use service interface to get the exact state
try {
mBluetoothLock.readLock().lock();
@@ -1863,7 +1867,6 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
} else {
Slog.w(TAG, "BT Enable in BLE_ON State, going to ON");
mBluetooth.onLeServiceUp(mContext.getAttributionSource());
persistBluetoothSetting(BLUETOOTH_ON_BLUETOOTH);
}
break;
case BluetoothAdapter.STATE_BLE_TURNING_ON: