Merge "Fix Bluetooth auto turns ON in airplane mode" am: 1b9f4dbd5d

Change-Id: I65735852f5f057e920c6b26980a253326c6a89bb
This commit is contained in:
Treehugger Robot
2020-03-30 02:53:17 +00:00
committed by Automerger Merge Worker

View File

@@ -888,6 +888,13 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "onBluetoothServiceUp: mBluetooth is null!");
return;
}
if (!mEnableExternal && !isBleAppPresent() && isAirplaneModeOn()) {
// Airplane mode is turned on while enabling BLE only mode, disable
// BLE now.
disableBleScanMode();
sendBrEdrDownCallback();
return;
}
if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) {
// This triggers transition to STATE_ON
mBluetooth.onLeServiceUp();