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

Commit 5a9c6aac authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding debug logs in ScrimController to help debug scrim weirdness" into main

parents 31c560bf f8b7606b
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -615,8 +615,8 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
                callback.onFinished();
            }
            return;
        } else if (DEBUG) {
            Log.d(TAG, "State changed to: " + state);
        } else {
            debugLog("State changed to: " + state);
        }

        if (state == ScrimState.UNINITIALIZED) {
@@ -693,6 +693,12 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
        dispatchBackScrimState(mScrimBehind.getViewAlpha());
    }

    private static void debugLog(String state) {
        if (DEBUG) {
            Log.d(TAG, state);
        }
    }

    public ScrimState getState() {
        return mState;
    }
@@ -995,6 +1001,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
    }

    private void applyState() {
        debugLog("Applying state: " + mState.name());
        mInFrontTint = mState.getFrontTint();
        mBehindTint = mState.getBehindTint();
        mNotificationsTint = mState.getNotifTint();
@@ -1597,9 +1604,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
            // 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 ? 32 : 500;
            if (DEBUG) {
                Log.d(TAG, "Fading out scrims with delay: " + delay);
            }
            debugLog("Fading out scrims with delay: " + delay);
            mHandler.postDelayed(mBlankingTransitionRunnable, delay);
        };
        doOnTheNextFrame(mPendingFrameCallback);
@@ -1689,9 +1694,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
    public void onScreenTurnedOn() {
        mScreenOn = true;
        if (mHandler.hasCallbacks(mBlankingTransitionRunnable)) {
            if (DEBUG) {
                Log.d(TAG, "Shorter blanking because screen turned on. All good.");
            }
            debugLog("Shorter blanking because screen turned on. All good.");
            mHandler.removeCallbacks(mBlankingTransitionRunnable);
            mBlankingTransitionRunnable.run();
        }