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

Commit 4e6e7fc2 authored by William Escande's avatar William Escande
Browse files

SystemServer: Satellite mode disable even BLE_ON

Bug: 333097218
Fix: 333097218
Test: m .
Test: manual activate satellite mode when device is in BLE_ON
Flag: Exempt, no user are using satellite mode, the flag will only delay
      the rollout of the fix (actively being work in testing) without
      adding value
Change-Id: I939444e478aa273eb37cbc03d2510d052ea0d8be
parent fed89254
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -465,7 +465,9 @@ class BluetoothManagerService {
        // Clear registered LE apps to force shut-off
        clearBleApps();

        if (!AirplaneModeListener.hasUserToggledApm(mCurrentUserContext)) {
        if (reason == ENABLE_DISABLE_REASON_SATELLITE_MODE
                || !AirplaneModeListener.hasUserToggledApm(mCurrentUserContext)) {
            // AirplaneMode can have a state where it does not impact the AutoOnFeature
            AutoOnFeature.pause();
        }

@@ -518,14 +520,15 @@ class BluetoothManagerService {
    }

    private void handleSatelliteModeChanged(boolean isSatelliteModeOn) {
        if (shouldBluetoothBeOn(isSatelliteModeOn) && getState() != STATE_ON) {
        final int currentState = mState.get();

        if (shouldBluetoothBeOn(isSatelliteModeOn) && currentState != STATE_ON) {
            sendEnableMsg(mQuietEnableExternal, ENABLE_DISABLE_REASON_SATELLITE_MODE);
        } else if (!shouldBluetoothBeOn(isSatelliteModeOn) && getState() != STATE_OFF) {
            AutoOnFeature.pause();
            sendDisableMsg(ENABLE_DISABLE_REASON_SATELLITE_MODE);
        } else if (!shouldBluetoothBeOn(isSatelliteModeOn) && currentState != STATE_OFF) {
            forceToOffFromModeChange(currentState, ENABLE_DISABLE_REASON_SATELLITE_MODE);
        } else if (!isSatelliteModeOn
                && !shouldBluetoothBeOn(isSatelliteModeOn)
                && getState() != STATE_ON) {
                && currentState != STATE_ON) {
            autoOnSetupTimer();
        }
    }