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

Commit f8b7606b authored by Chandru S's avatar Chandru S
Browse files

Adding debug logs in ScrimController to help debug scrim weirdness

Bug: 405424190
Flag: EXEMPT logging changes
Test: NA
Change-Id: I89a627d6448674974d60b986f4f2072cfbc8d894
parent 0def0884
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();
        }