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." into sc-v2-dev am: aab8a8ec0f

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

Change-Id: I8c3b403052114de3d85911b360bb46d7bf9f8ac5
This commit is contained in:
Himanshu Rawat
2021-12-24 00:57:00 +00:00
committed by Automerger Merge Worker

View File

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