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

Commit ce1f5cd1 authored by Kweku Adams's avatar Kweku Adams
Browse files

Fix conditional check bug.

The power mode change event should only be filtered if launch boost is
disabled. That can only occur when the device supports battery saver and
has a battery saver state machine instance. Thus, if the battery saver
state machine doesn't exist, the power mode change event should not be
filtered.

Bug: 315728239
Bug: 317053395
Test: N/A
Change-Id: I83057cbfa53725b5fc19cc1ca4096b8b4b93d4dd
parent 4d29ed23
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -4405,8 +4405,8 @@ public final class PowerManagerService extends SystemService

    private boolean setPowerModeInternal(int mode, boolean enabled) {
        // Maybe filter the event.
        if (mBatterySaverStateMachine == null || (mode == Mode.LAUNCH && enabled
                && mBatterySaverStateMachine.getBatterySaverController().isLaunchBoostDisabled())) {
        if (mode == Mode.LAUNCH && enabled && mBatterySaverStateMachine != null
                && mBatterySaverStateMachine.getBatterySaverController().isLaunchBoostDisabled()) {
            return false;
        }
        return mNativeWrapper.nativeSetPowerMode(mode, enabled);