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

Commit bd34fb00 authored by William Xiao's avatar William Xiao Committed by Android (Google) Code Review
Browse files

Merge "Fix blurred shade not having scrims on dream and hub" into main

parents 05d4f9aa cbda63c5
Loading
Loading
Loading
Loading
+58 −25
Original line number Diff line number Diff line
@@ -28,10 +28,10 @@ import com.android.systemui.scrim.ScrimView;
import com.android.systemui.shade.ui.ShadeColors;
import com.android.systemui.statusbar.notification.stack.StackStateAnimator;

import java.util.function.Supplier;

import kotlinx.coroutines.ExperimentalCoroutinesApi;

import java.util.function.Supplier;

/**
 * Possible states of the ScrimController state machine.
 */
@@ -340,6 +340,17 @@ public enum ScrimState {
    DREAMING {
        @Override
        public void prepare(ScrimState previousState) {
            if (Flags.notificationShadeBlur()) {
                // Scrim parameters should match SHADE_LOCKED like other activities occluding
                // keyguard.
                mBehindTint = ShadeColors.shadePanel(mScrimBehind.getResources(),
                        mIsBlurSupported.get());
                mBehindAlpha = Color.alpha(mBehindTint) / 255.0f;
                mNotifTint = ShadeColors.notificationScrim(mScrimBehind.getResources(),
                        mIsBlurSupported.get());
                mNotifAlpha = Color.alpha(mNotifTint) / 255.0f;
                mFrontAlpha = 0.0f;
            } else {
                mFrontTint = Color.TRANSPARENT;
                mBehindTint = mBackgroundColor;
                mNotifTint = mClipQsScrim ? mBackgroundColor : Color.TRANSPARENT;
@@ -354,6 +365,7 @@ public enum ScrimState {
                    updateScrimColor(mScrimBehind, 1f /* alpha */, mBackgroundColor);
                }
            }
        }
    },

    /**
@@ -364,6 +376,15 @@ public enum ScrimState {
    GLANCEABLE_HUB {
        @Override
        public void prepare(ScrimState previousState) {
            if (Flags.notificationShadeBlur()) {
                // Scrim parameters should match KEYGUARD as we're showing on top of keyguard.
                mBehindTint = Color.TRANSPARENT;
                mNotifTint = ShadeColors.notificationScrim(mScrimBehind.getResources(),
                        mIsBlurSupported.get());
                mBehindAlpha = 0.0f;
                mNotifAlpha = 0.0f;
                mFrontAlpha = 0.0f;
            } else {
                // No scrims should be visible by default in this state.
                mBehindAlpha = 0;
                mNotifAlpha = 0;
@@ -373,6 +394,7 @@ public enum ScrimState {
                mBehindTint = mBackgroundColor;
                mNotifTint = mClipQsScrim ? mBackgroundColor : Color.TRANSPARENT;
            }
        }
    },

    /**
@@ -386,6 +408,16 @@ public enum ScrimState {
    GLANCEABLE_HUB_OVER_DREAM {
        @Override
        public void prepare(ScrimState previousState) {
            if (Flags.notificationShadeBlur()) {
                // Scrim parameters should match DREAM as hub is showing while on top of the dream.
                mBehindTint = ShadeColors.shadePanel(mScrimBehind.getResources(),
                        mIsBlurSupported.get());
                mBehindAlpha = Color.alpha(mBehindTint) / 255.0f;
                mNotifTint = ShadeColors.notificationScrim(mScrimBehind.getResources(),
                        mIsBlurSupported.get());
                mNotifAlpha = Color.alpha(mNotifTint) / 255.0f;
                mFrontAlpha = 0.0f;
            } else {
                // No scrims should be visible by default in this state.
                mBehindAlpha = 0;
                mNotifAlpha = 0;
@@ -395,6 +427,7 @@ public enum ScrimState {
                mBehindTint = mBackgroundColor;
                mNotifTint = mClipQsScrim ? mBackgroundColor : Color.TRANSPARENT;
            }
        }
    };

    boolean mBlankScreen = false;