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

Commit 7b7621f5 authored by Sean Stout's avatar Sean Stout
Browse files

Fix screen not turning off correctly.

If a device was not set to doze after sleep, it was possible to hit the
power button and for the display to not turn off.

This change makes the display go to the off state if there is another
display which is currently on in this scenario.

Test: manual - Use device with external display. Hit power button.
Detach external display.
Bug: 185934103

Change-Id: I6412955ee44d13c4fbab4167f4f3a26415441983
parent 7cdf7123
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2956,8 +2956,7 @@ public final class PowerManagerService extends SystemService
                // Group has been removed.
                return;
            }
            // TODO (b/175764708): Support per-display doze.
            wakefulness = getWakefulnessLocked();
            wakefulness = mDisplayGroupPowerStateMapper.getWakefulnessLocked(groupId);
            if ((wakefulness == WAKEFULNESS_DREAMING || wakefulness == WAKEFULNESS_DOZING) &&
                    mDisplayGroupPowerStateMapper.isSandmanSummoned(groupId)
                    && mDisplayGroupPowerStateMapper.isReady(groupId)) {
@@ -3099,6 +3098,7 @@ public final class PowerManagerService extends SystemService
     * Returns true if the device is allowed to doze in its current state.
     */
    private boolean canDozeLocked() {
        // TODO (b/175764708): Support per-display doze.
        return getWakefulnessLocked() == WAKEFULNESS_DOZING;
    }