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

Commit d897271c authored by Lucas Dupin's avatar Lucas Dupin Committed by Android (Google) Code Review
Browse files

Merge "Shorter scrim delay if display is on"

parents 25e38fd4 3a64ed78
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -167,6 +167,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
    private boolean mScreenBlankingCallbackCalled;
    private Callback mCallback;
    private boolean mWallpaperSupportsAmbientMode;
    private boolean mScreenOn;

    // Scrim blanking callbacks
    private Choreographer.FrameCallback mPendingFrameCallback;
@@ -792,10 +793,11 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,

            // Setting power states can happen after we push out the frame. Make sure we
            // stay fully opaque until the power state request reaches the lower levels.
            final int delay = mScreenOn ? 16 : 500;
            if (DEBUG) {
                Log.d(TAG, "Waiting for the screen to turn on...");
                Log.d(TAG, "Fading out scrims with delay: " + delay);
            }
            getHandler().postDelayed(mBlankingTransitionRunnable, 500);
            getHandler().postDelayed(mBlankingTransitionRunnable, delay);
        };
        doOnTheNextFrame(mPendingFrameCallback);
    }
@@ -911,6 +913,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
     * Interrupts blanking transitions once the display notifies that it's already on.
     */
    public void onScreenTurnedOn() {
        mScreenOn = true;
        final Handler handler = getHandler();
        if (handler.hasCallbacks(mBlankingTransitionRunnable)) {
            if (DEBUG) {
@@ -921,6 +924,10 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        }
    }

    public void onScreenTurnedOff() {
        mScreenOn = false;
    }

    public interface Callback {
        default void onStart() {
        }
+1 −0
Original line number Diff line number Diff line
@@ -4413,6 +4413,7 @@ public class StatusBar extends SystemUI implements DemoMode,
        @Override
        public void onScreenTurnedOff() {
            mFalsingManager.onScreenOff();
            mScrimController.onScreenTurnedOff();
            // If we pulse in from AOD, we turn the screen off first. However, updatingIsKeyguard
            // in that case destroys the HeadsUpManager state, so don't do it in that case.
            if (!isPulsing()) {