Merge "Fix Bluetooth auto turns ON in airplane mode" into rvc-dev

This commit is contained in:
Ugo Yu
2020-03-31 04:42:07 +00:00
committed by Android (Google) Code Review

View File

@@ -969,6 +969,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();