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

Commit cc984186 authored by Tracy Zhou's avatar Tracy Zhou Committed by Android (Google) Code Review
Browse files

Merge "Use the correct lockscreen signal for showing non transparent...

Merge "Use the correct lockscreen signal for showing non transparent notification shelf background" into main
parents 9cc41f7f 77119899
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.statusbar;

import static com.android.keyguard.BouncerPanelExpansionCalculator.aboutToShowBouncerProgress;
import static com.android.systemui.Flags.notificationRowTransparency;
import static com.android.systemui.Flags.physicalNotificationMovement;
import static com.android.systemui.util.ColorUtilKt.hexColorString;

@@ -1068,11 +1069,6 @@ public class NotificationShelf extends ActivatableNotificationView {
        return false;
    }

    @Override
    protected boolean usesTransparentBackground() {
        return super.usesTransparentBackground() && !mAmbientState.isOnKeyguard();
    }

    public void setCanModifyColorOfNotifications(boolean canModifyColorOfNotifications) {
        mCanModifyColorOfNotifications = canModifyColorOfNotifications;
    }
@@ -1102,6 +1098,7 @@ public class NotificationShelf extends ActivatableNotificationView {
            DumpUtilsKt.withIncreasedIndent(pw, () -> {
                pw.println("mActualWidth: " + mActualWidth);
                pw.println("mStatusBarHeight: " + mStatusBarHeight);
                pw.println("isOnKeyguard: " + isOnKeyguard());
            });
        }
    }
+31 −1
Original line number Diff line number Diff line
@@ -121,6 +121,12 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    protected Point mTargetPoint;
    private boolean mDismissed;
    private boolean mRefocusOnDismiss;
    /**
     * Whether the notification is on the keyguard. This is used to disable the transparent
     * background, and the {@link ExpandableNotificationRow} additionally uses this to disable
     * expansion.
     */
    protected boolean mOnKeyguard;
    protected boolean mIsBlurSupported;

    public ActivatableNotificationView(Context context, AttributeSet attrs) {
@@ -343,7 +349,7 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
    }

    protected boolean usesTransparentBackground() {
        return mIsBlurSupported && notificationRowTransparency();
        return mIsBlurSupported && notificationRowTransparency() && !mOnKeyguard;
    }

    @Override
@@ -826,6 +832,30 @@ public abstract class ActivatableNotificationView extends ExpandableOutlineView
        mTouchHandler = touchHandler;
    }

    /**
     * Sets whether this view is on the keyguard.
     * Subclass implementations must set {@link #mOnKeyguard} to the given value.
     * @see #isOnKeyguard()
     */
    public void setOnKeyguard(boolean onKeyguard) {
        if (mOnKeyguard == onKeyguard) {
            return;
        }

        mOnKeyguard = onKeyguard;
        if (notificationRowTransparency()) {
            updateBackgroundTint();
        }
    }

    /**
     * Whether this row is displayed over the unoccluded lockscreen. Returns false on the
     * locked shade.
     */
    public boolean isOnKeyguard() {
        return mOnKeyguard;
    }

    @Override
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
+23 −36
Original line number Diff line number Diff line
@@ -271,11 +271,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
     */
    private boolean mIsSystemExpanded;

    /**
     * Whether the notification is on the keyguard and the expansion is disabled.
     */
    private boolean mOnKeyguard;

    private Animator mTranslateAnim;
    private ArrayList<View> mTranslateableViews;
    private NotificationContentView mPublicLayout;
@@ -1802,14 +1797,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        return mPrivateLayout.getSingleLineView();
    }

    /**
     * Whether this row is displayed over the unoccluded lockscreen. Returns false on the
     * locked shade.
     */
    public boolean isOnKeyguard() {
        return mOnKeyguard;
    }

    @Override
    public void dismiss(boolean refocusOnDismiss) {
        super.dismiss(refocusOnDismiss);
@@ -3254,12 +3241,17 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        }
    }

    /** @see #isOnKeyguard() */
    @Override
    public void setOnKeyguard(boolean onKeyguard) {
        if (onKeyguard != mOnKeyguard) {
        if (onKeyguard == mOnKeyguard) {
            return;
        }

        boolean wasAboveShelf = isAboveShelf();
        final boolean wasExpanded = isExpanded();
            mOnKeyguard = onKeyguard;

        super.setOnKeyguard(onKeyguard);

        onExpansionChanged(false /* userAction */, wasExpanded);
        if (wasExpanded != isExpanded()) {
            if (mIsSummaryWithChildren) {
@@ -3275,10 +3267,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
                mChildrenContainer.setOnKeyguard(onKeyguard);
            }
        }
            if (notificationRowTransparency()) {
                updateBackgroundTint();
            }
        }
    }

    @Override
@@ -4889,7 +4877,6 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
        return super.usesTransparentBackground()
                && !mustStayOnScreen()
                && !(isChildInGroup() && !mNotificationParent.usesTransparentBackground())
                && !mHeadsupDisappearRunning
                && !mOnKeyguard;
                && !mHeadsupDisappearRunning;
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -5512,6 +5512,7 @@ public class NotificationStackScrollLayout
                    childRow.setOnKeyguard(isOnLockscreen);
                }
            }
            mShelf.setOnKeyguard(isOnLockscreen);
        }
    }

@@ -5602,6 +5603,9 @@ public class NotificationStackScrollLayout
    public void setStatusBarState(int statusBarState) {
        mStatusBarState = statusBarState;
        mAmbientState.setStatusBarState(statusBarState);
        if (!SceneContainerFlag.isEnabled()) {
            mShelf.setOnKeyguard(statusBarState == StatusBarState.KEYGUARD);
        }
        updateSpeedBumpIndex();
        updateDismissBehavior();
    }