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

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

Merge changes I4b934c9e,I6898a470 into main

* changes:
  Remove unused field mLaunchingAffordanceWithPreview from ScrimState
  Force behind and notification scrim alpha to be 0 when the device is unlocking.
parents 5c5f3a06 aefbeee8
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -1014,13 +1014,17 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
        assertAlphasValid();

        if (!mExpansionAffectsAlpha) {
            debugLog("Early return in applyState");
            if (Flags.notificationShadeBlur() && mState == ScrimState.UNLOCKED) {
                mBehindAlpha = 0.0f;
                mNotificationsAlpha = 0.0f;
            }
            return;
        }

        if (mState == ScrimState.UNLOCKED || mState == ScrimState.DREAMING
                || mState == ScrimState.GLANCEABLE_HUB_OVER_DREAM) {
            final boolean occluding =
                    mOccludeAnimationPlaying || mState.mLaunchingAffordanceWithPreview;
            final boolean occluding = mOccludeAnimationPlaying;
            // Darken scrim as it's pulled down while unlocked. If we're unlocked but playing the
            // screen off/occlusion animations, ignore expansion changes while those animations
            // play.
@@ -1741,12 +1745,6 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener, Dump
        }
    }

    public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) {
        for (ScrimState state : ScrimState.values()) {
            state.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);
        }
    }

    public interface Callback {
        default void onStart() {
        }
+1 −8
Original line number Diff line number Diff line
@@ -326,9 +326,7 @@ public enum ScrimState {
            // If launch/occlude animations were playing, they already animated the scrim
            // alpha to 0f as part of the animation. If we animate it now, we'll set it back
            // to 1f and animate it back to 0f, causing an unwanted scrim flash.
            mAnimateChange = !mLaunchingAffordanceWithPreview
                    && !mOccludeAnimationPlaying
                    && !fromAod;
            mAnimateChange = !mOccludeAnimationPlaying && !fromAod;

            mFrontTint = Color.TRANSPARENT;
            mBehindTint = mBackgroundColor;
@@ -532,7 +530,6 @@ public enum ScrimState {
    DozeParameters mDozeParameters;
    DockManager mDockManager;
    boolean mDisplayRequiresBlanking;
    boolean mLaunchingAffordanceWithPreview;
    boolean mOccludeAnimationPlaying;
    boolean mWakeLockScreenSensorActive;
    boolean mKeyguardFadingAway;
@@ -643,10 +640,6 @@ public enum ScrimState {
        mNotificationScrimColor = notificationScrimColor;
    }

    public void setLaunchingAffordanceWithPreview(boolean launchingAffordanceWithPreview) {
        mLaunchingAffordanceWithPreview = launchingAffordanceWithPreview;
    }

    public void setOccludeAnimationPlaying(boolean occludeAnimationPlaying) {
        mOccludeAnimationPlaying = occludeAnimationPlaying;
    }