Fix Bluetooth auto turns ON in airplane mode
Fix a race condition that mBleApps is cleared while turning ON BLE,
this causes Bluetooth turns on classic profiles instead of stays in
BLE_ON state.
Bug: 142220937
Test: enableBle() -> turn on airplane mode, check Bluetooth does not
turn to ON.
Change-Id: I3cea5384f734dde269cf93a93ed7cc4173f669a0
This commit is contained in:
@@ -881,6 +881,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();
|
||||
|
||||
Reference in New Issue
Block a user