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

Commit 05726cd4 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Bouncer notification and QS scrim

Show front scrim when the notification panel is expanded,
otherwise pin would be overlayed on top of notifications.

Change-Id: Ia438f4a2794eb9510ec05ad86cc8c19e2e716358
Fixes: 74550013
Test: double tap on notification when locked
Test: tap on QS edit button when locked
Test: unlock by swipping up
Test: fling quickly on keyguard
parent 0df9b7a8
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -947,6 +947,17 @@ public abstract class PanelView extends FrameLayout {
        return mClosing || mLaunchingNotification;
    }

    /**
     * Bouncer might need a scrim when you double tap on notifications or edit QS.
     * On other cases, when you drag up the bouncer with the finger or just fling,
     * the scrim should be hidden to avoid occluding the clock.
     *
     * @return true when we need a scrim to show content on top of the notification panel.
     */
    public boolean needsScrimming() {
        return !isTracking() && !isCollapsing() && !isFullyCollapsed();
    }

    public boolean isTracking() {
        return mTracking;
    }
+1 −1
Original line number Diff line number Diff line
@@ -449,7 +449,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,
        if (mNeedsDrawableColorUpdate) {
            mNeedsDrawableColorUpdate = false;
            final GradientColors currentScrimColors;
            if (mState == ScrimState.KEYGUARD || mState == ScrimState.BOUNCER_OCCLUDED
            if (mState == ScrimState.KEYGUARD || mState == ScrimState.BOUNCER_SCRIMMED
                    || mState == ScrimState.BOUNCER) {
                // Always animate color changes if we're seeing the keyguard
                mScrimInFront.setColors(mLockColors, true /* animated */);
+1 −1
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public enum ScrimState {
    /**
     * Showing password challenge on top of a FLAG_SHOW_WHEN_LOCKED activity.
     */
    BOUNCER_OCCLUDED(2) {
    BOUNCER_SCRIMMED(2) {
        @Override
        public void prepare(ScrimState previousState) {
            mCurrentBehindAlpha = 0;
+4 −3
Original line number Diff line number Diff line
@@ -4631,9 +4631,10 @@ public class StatusBar extends SystemUI implements DemoMode,
                != FingerprintUnlockController.MODE_UNLOCK);

        if (mBouncerShowing) {
            final boolean qsExpanded = mQSPanel != null && mQSPanel.isExpanded();
            mScrimController.transitionTo(mIsOccluded || qsExpanded ?
                    ScrimState.BOUNCER_OCCLUDED : ScrimState.BOUNCER);
            // Bouncer needs the front scrim when it's on top of an activity,
            // tapping on a notification or editing QS.
            mScrimController.transitionTo(mIsOccluded || mNotificationPanel.needsScrimming() ?
                    ScrimState.BOUNCER_SCRIMMED : ScrimState.BOUNCER);
        } else if (mLaunchCameraOnScreenTurningOn || isInLaunchTransition()) {
            mScrimController.transitionTo(ScrimState.UNLOCKED, mUnlockScrimCallback);
        } else if (mBrightnessMirrorVisible) {
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ public class KeyguardBouncerTest extends SysuiTestCase {
    @Test
    public void testShow_resetsSecuritySelection() {
        mBouncer.show(false);
        verify(mKeyguardHostView, never());
        verify(mKeyguardHostView, never()).showPrimarySecurityScreen();

        mBouncer.hide(false);
        mBouncer.show(true);
Loading