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

Commit 4797761f authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Update showing udfps keyguard affordance logic

- Don't show if QS is expanded

Test: manual
Bug: 183112863
Bug: 175717712
Change-Id: I9836e391d32982613e7a04b4e97bc9f4d8bbf986
parent b4a4b46b
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
    @NonNull private final StatusBarKeyguardViewManager mKeyguardViewManager;

    private boolean mForceShow;
    private boolean mQsExpanded;

    protected UdfpsKeyguardViewController(
            @NonNull UdfpsKeyguardView view,
@@ -64,7 +65,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
    protected void onViewDetached() {
        super.onViewDetached();
        mStatusBarStateController.removeCallback(mStateListener);
        mAlternateAuthInterceptor.reset();
        mAlternateAuthInterceptor.resetForceShow();
        mKeyguardViewManager.setAlternateAuthInterceptor(null);
    }

@@ -100,6 +101,11 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
        if (mForceShow) {
            return false;
        }

        if (mQsExpanded) {
            return true;
        }

        return super.shouldPauseAuth();
    }

@@ -130,7 +136,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                }

                @Override
                public boolean reset() {
                public boolean resetForceShow() {
                    if (!mForceShow) {
                        return false;
                    }
@@ -140,7 +146,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                }

                @Override
                public boolean isShowingAlternativeAuth() {
                public boolean isShowingAlternateAuth() {
                    return mForceShow;
                }

@@ -149,6 +155,12 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                    return mView.isAnimating();
                }

                @Override
                public void setQsExpanded(boolean expanded) {
                    mQsExpanded = expanded;
                    updatePauseAuth();
                }

                @Override
                public void dump(PrintWriter pw) {
                    pw.print(getTag());
+4 −3
Original line number Diff line number Diff line
@@ -1824,6 +1824,7 @@ public class NotificationPanelViewController extends PanelViewController {
            mNotificationContainerParent.setQsExpanded(expanded);
            mPulseExpansionHandler.setQsExpanded(expanded);
            mKeyguardBypassController.setQSExpanded(expanded);
            mStatusBarKeyguardViewManager.setQsExpanded(expanded);
        }
    }

@@ -3389,7 +3390,7 @@ public class NotificationPanelViewController extends PanelViewController {
        return new TouchHandler() {
            @Override
            public boolean onInterceptTouchEvent(MotionEvent event) {
                if (mStatusBarKeyguardViewManager.isShowingAlternativeAuthOrAnimating()) {
                if (mStatusBarKeyguardViewManager.isShowingAlternateAuthOrAnimating()) {
                    return true;
                }
                if (mBlockTouches || mQsFullyExpanded && mQs.disallowPanelTouches()) {
@@ -3420,8 +3421,8 @@ public class NotificationPanelViewController extends PanelViewController {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                final boolean showingOrAnimatingAltAuth =
                        mStatusBarKeyguardViewManager.isShowingAlternativeAuthOrAnimating();
                if (showingOrAnimatingAltAuth) {
                        mStatusBarKeyguardViewManager.isShowingAlternateAuthOrAnimating();
                if (showingOrAnimatingAltAuth && event.getAction() == MotionEvent.ACTION_DOWN) {
                    mStatusBarKeyguardViewManager.resetAlternateAuth();
                }

+1 −1
Original line number Diff line number Diff line
@@ -454,7 +454,7 @@ public abstract class PanelViewController {
                mView.postOnAnimation(mPostCollapseRunnable);
            }
        } else if (!mStatusBar.isBouncerShowing()
                && !mStatusBarKeyguardViewManager.isShowingAlternativeAuthOrAnimating()) {
                && !mStatusBarKeyguardViewManager.isShowingAlternateAuthOrAnimating()) {
            boolean expands = onEmptySpaceClick(mInitialTouchX);
            onTrackingStopped(expands);
        }
+1 −1
Original line number Diff line number Diff line
@@ -4187,7 +4187,7 @@ public class StatusBar extends SystemUI implements DemoMode,
                mNotificationPanelViewController.isLaunchingAffordanceWithPreview();
        mScrimController.setLaunchingAffordanceWithPreview(launchingAffordanceWithPreview);

        if (mStatusBarKeyguardViewManager.isShowingAlternativeAuth()) {
        if (mStatusBarKeyguardViewManager.isShowingAlternateAuth()) {
            mScrimController.transitionTo(ScrimState.AUTH_SCRIMMED);
        } else if (mBouncerShowing) {
            // Bouncer needs the front scrim when it's on top of an activity,
+25 −10
Original line number Diff line number Diff line
@@ -476,11 +476,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
                return;
            }

            if (mAlternateAuthInterceptor != null
                    && mAlternateAuthInterceptor.showAlternativeAuthMethod()) {
                mStatusBar.updateScrimController();
            if (mAlternateAuthInterceptor != null) {
                mAfterKeyguardGoneAction = r;
                mKeyguardGoneCancelAction = cancelAction;
                if (mAlternateAuthInterceptor.showAlternativeAuthMethod()) {
                    mStatusBar.updateScrimController();
                }
                return;
            }

@@ -528,7 +529,7 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
     * Stop showing any alternate auth methods
     */
    public void resetAlternateAuth() {
        if (mAlternateAuthInterceptor != null && mAlternateAuthInterceptor.reset()) {
        if (mAlternateAuthInterceptor != null && mAlternateAuthInterceptor.resetForceShow()) {
            mStatusBar.updateScrimController();
        }
    }
@@ -1125,18 +1126,27 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        setDozing(isDozing);
    }

    /**
     * Set whether qs is currently expanded
     */
    public void setQsExpanded(boolean expanded) {
        if (mAlternateAuthInterceptor != null) {
            mAlternateAuthInterceptor.setQsExpanded(expanded);
        }
    }

    public KeyguardBouncer getBouncer() {
        return mBouncer;
    }

    public boolean isShowingAlternativeAuth() {
    public boolean isShowingAlternateAuth() {
        return mAlternateAuthInterceptor != null
                && mAlternateAuthInterceptor.isShowingAlternativeAuth();
                && mAlternateAuthInterceptor.isShowingAlternateAuth();
    }

    public boolean isShowingAlternativeAuthOrAnimating() {
    public boolean isShowingAlternateAuthOrAnimating() {
        return mAlternateAuthInterceptor != null
                && (mAlternateAuthInterceptor.isShowingAlternativeAuth()
                && (mAlternateAuthInterceptor.isShowingAlternateAuth()
                || mAlternateAuthInterceptor.isAnimating());
    }

@@ -1169,12 +1179,12 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
         * reset the state to the default (only keyguard showing, no auth methods showing)
         * @return whether alternative auth method was newly hidden
         */
        boolean reset();
        boolean resetForceShow();

        /**
         * @return true if alternative auth method is showing
         */
        boolean isShowingAlternativeAuth();
        boolean isShowingAlternateAuth();

        /**
         * print information for the alternate auth interceptor registered
@@ -1185,5 +1195,10 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
         * @return true if the new auth method is currently animating in or out.
         */
        boolean isAnimating();

        /**
         * Set whether qs is currently expanded
         */
        void setQsExpanded(boolean expanded);
    }
}
Loading