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

Commit 23cdf1a4 authored by Santos Cordon's avatar Santos Cordon Committed by android-build-merger
Browse files

Merge "Hold Display suspend blocker until doze starts" into qt-r1-dev

am: 48a86fee

Change-Id: I15d47b96d0b937c720eca379d34a73da5f00a6d2
parents 56b04b17 48a86fee
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2735,6 +2735,17 @@ public final class PowerManagerService extends SystemService
        if (mScreenBrightnessBoostInProgress) {
            return true;
        }

        // Because summoning the sandman is asyncronous, there is a time-gap where
        // we release the display suspend blocker before the dream service acquires
        // their own wakelock.  Within this gap, we can end up suspending before
        // dream service has a chance to start.  To avoid this, we check if we want
        // to doze and the sandman is scheduled and if so, keep the display on until
        // that has passed.
        if (mWakefulness == WAKEFULNESS_DOZING && mSandmanScheduled) {
            return true;
        }

        // Let the system suspend if the screen is off or dozing.
        return false;
    }