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

Commit b6219b37 authored by Beverly's avatar Beverly
Browse files

Update swipe up from the locked shade behavior

If the device has UDFPS enrolled, swiping up from
the locked shade on keyguard brings the user back to
the lock screen instead of showing the bouncer. We
do this because the lock screen still has the UDFPS
affordance for device entry. Users can additionally
swipe up again if they want to use the input bouncer
for device entry.

Test: manual
Fixes: 198231678
Change-Id: I3fcc754f0b2b8cab538c9f709f36f829b5049f08
parent 8a05667f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -320,6 +320,10 @@ public class KeyguardHostViewController extends ViewController<KeyguardHostView>
        mKeyguardSecurityContainerController.showPrimarySecurityScreen(false);
    }

    /**
     * Fades and translates in/out the security screen.
     * @param fraction amount of the screen that should show.
     */
    public void setExpansion(float fraction) {
        float alpha = MathUtils.map(KeyguardBouncer.ALPHA_EXPANSION_THRESHOLD, 1, 1, 0, fraction);
        mView.setAlpha(MathUtils.constrain(alpha, 0f, 1f));
+10 −6
Original line number Diff line number Diff line
@@ -2109,7 +2109,7 @@ public class StatusBar extends SystemUI implements
        mShadeController.runPostCollapseRunnables();
        setInteracting(StatusBarManager.WINDOW_STATUS_BAR, false);
        if (!mNotificationActivityStarter.isCollapsingToShowActivityOverLockscreen()) {
            showBouncerIfKeyguard();
            showBouncerOrLockScreenIfKeyguard();
        } else if (DEBUG) {
            Log.d(TAG, "Not showing bouncer due to activity showing over lockscreen");
        }
@@ -3315,13 +3315,17 @@ public class StatusBar extends SystemUI implements
        return false;
    }

    private void showBouncerIfKeyguard() {
    private void showBouncerOrLockScreenIfKeyguard() {
        if (!mKeyguardViewMediator.isHiding()) {
            if (mState == StatusBarState.KEYGUARD
                    && !mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing()) {
            if (mState == StatusBarState.SHADE_LOCKED
                    && mKeyguardUpdateMonitor.isUdfpsEnrolled()) {
                // shade is showing while locked on the keyguard, so go back to showing the
                // lock screen where users can use the UDFPS affordance to enter the device
                mStatusBarKeyguardViewManager.reset(true);
            } else if ((mState == StatusBarState.KEYGUARD
                    && !mStatusBarKeyguardViewManager.bouncerIsOrWillBeShowing())
                    || mState == StatusBarState.SHADE_LOCKED) {
                mStatusBarKeyguardViewManager.showGenericBouncer(true /* scrimmed */);
            } else if (mState == StatusBarState.SHADE_LOCKED) {
                mStatusBarKeyguardViewManager.showBouncer(true /* scrimmed */);
            }
        }
    }
+7 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@ import com.android.systemui.shared.system.SysUiStatsLog;
import com.android.systemui.statusbar.NotificationMediaManager;
import com.android.systemui.statusbar.NotificationShadeWindowController;
import com.android.systemui.statusbar.RemoteInputController;
import com.android.systemui.statusbar.StatusBarState;
import com.android.systemui.statusbar.SysuiStatusBarStateController;
import com.android.systemui.statusbar.notification.ViewGroupFadeHelper;
import com.android.systemui.statusbar.phone.KeyguardBouncer.BouncerExpansionCallback;
@@ -337,6 +338,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        // • Full-screen user switcher is displayed.
        if (mNotificationPanelViewController.isUnlockHintRunning()) {
            mBouncer.setExpansion(KeyguardBouncer.EXPANSION_HIDDEN);
        } else if (mStatusBarStateController.getState() == StatusBarState.SHADE_LOCKED
                && mKeyguardUpdateManager.isUdfpsEnrolled()) {
            // Don't expand to the bouncer. Instead transition back to the lock screen (see
            // StatusBar#showBouncerOrLockScreenIfKeyguard) where the user can use the UDFPS
            // affordance to enter the device (or swipe up to the input bouncer)
            return;
        } else if (bouncerNeedsScrimming()) {
            mBouncer.setExpansion(KeyguardBouncer.EXPANSION_VISIBLE);
        } else if (mShowing) {