Merge "Disable Bluetooth if BLE was disabled while enabling" into rvc-dev

This commit is contained in:
TreeHugger Robot
2020-06-03 01:27:01 +00:00
committed by Android (Google) Code Review

View File

@@ -954,7 +954,8 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
} }
/** /**
* Call IBluetooth.onLeServiceUp() to continue if Bluetooth should be on. * Call IBluetooth.onLeServiceUp() to continue if Bluetooth should be on,
* call IBluetooth.onBrEdrDown() to disable if Bluetooth should be off.
*/ */
private void continueFromBleOnState() { private void continueFromBleOnState() {
if (DBG) { if (DBG) {
@@ -966,11 +967,10 @@ class BluetoothManagerService extends IBluetoothManager.Stub {
Slog.e(TAG, "onBluetoothServiceUp: mBluetooth is null!"); Slog.e(TAG, "onBluetoothServiceUp: mBluetooth is null!");
return; return;
} }
if (!mEnableExternal && !isBleAppPresent() && isAirplaneModeOn()) { if (!mEnableExternal && !isBleAppPresent()) {
// Airplane mode is turned on while enabling BLE only mode, disable Slog.i(TAG, "Bluetooth was disabled while enabling BLE, disable BLE now");
// BLE now. mEnable = false;
disableBleScanMode(); mBluetooth.onBrEdrDown();
sendBrEdrDownCallback();
return; return;
} }
if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) { if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) {