Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 47c64170 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Disable Bluetooth if BLE was disabled while enabling" am: b101411b

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

Change-Id: I3342018676f54a9930a3a661a243ce06cf4f9808
parents afbf7781 b101411b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -914,7 +914,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() {
        if (DBG) {
@@ -926,11 +927,10 @@ 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();
            if (!mEnableExternal && !isBleAppPresent()) {
                Slog.i(TAG, "Bluetooth was disabled while enabling BLE, disable BLE now");
                mEnable = false;
                mBluetooth.onBrEdrDown();
                return;
            }
            if (isBluetoothPersistedStateOnBluetooth() || !isBleAppPresent()) {