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

Commit 47c4bc7e authored by Lucas Dupin's avatar Lucas Dupin Committed by android-build-merger
Browse files

Merge "Misc bouncer fixes" into pi-dev am: 7362e18a

am: 5b9df55b

Change-Id: Iceef05e5393c12b436765d48052390ba1cb7384e
parents 98844072 5b9df55b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -159,6 +159,11 @@ public class KeyguardBouncer {
     */
    public void onFullyShown() {
        mFalsingManager.onBouncerShown();
        if (mKeyguardView == null) {
            Log.wtf(TAG, "onFullyShown when view was null");
        } else {
            mKeyguardView.onResume();
        }
    }

    /**
@@ -180,7 +185,6 @@ public class KeyguardBouncer {
        @Override
        public void run() {
            mRoot.setVisibility(View.VISIBLE);
            mKeyguardView.onResume();
            showPromptReason(mBouncerPromptReason);
            final CharSequence customMessage = mCallback.consumeCustomMessage();
            if (customMessage != null) {
@@ -296,7 +300,7 @@ public class KeyguardBouncer {

    public boolean isShowing() {
        return (mShowingSoon || (mRoot != null && mRoot.getVisibility() == View.VISIBLE))
                && mExpansion == 0;
                && mExpansion == 0 && !isAnimatingAway();
    }

    /**
+8 −13
Original line number Diff line number Diff line
@@ -89,7 +89,6 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
    protected boolean mFirstUpdate = true;
    protected boolean mLastShowing;
    protected boolean mLastOccluded;
    private boolean mLastTracking;
    private boolean mLastBouncerShowing;
    private boolean mLastBouncerDismissible;
    protected boolean mLastRemoteInputActive;
@@ -152,28 +151,19 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        // • The user quickly taps on the display and we show "swipe up to unlock."
        // • Keyguard will be dismissed by an action. a.k.a: FLAG_DISMISS_KEYGUARD_ACTIVITY
        // • Full-screen user switcher is displayed.
        final boolean noLongerTracking = mLastTracking != tracking && !tracking;
        if (mOccluded || mNotificationPanelView.isUnlockHintRunning()
                || mBouncer.willDismissWithAction()
                || mStatusBar.isFullScreenUserSwitcherState()) {
            mBouncer.setExpansion(0);
        } else if (mShowing && mStatusBar.isKeyguardCurrentlySecure() && !mDozing) {
            mBouncer.setExpansion(expansion);
            if (expansion == 1) {
                mBouncer.onFullyHidden();
            } else if (!mBouncer.isShowing() && !mBouncer.isAnimatingAway()) {
            if (expansion != 1 && tracking && !mBouncer.isShowing()
                    && !mBouncer.isAnimatingAway()) {
                mBouncer.show(false /* resetSecuritySelection */, false /* animated */);
            } else if (noLongerTracking) {
                // Notify that falsing manager should stop its session when user stops touching,
                // even before the animation ends, to guarantee that we're not recording sensitive
                // data.
                mBouncer.onFullyShown();
            }
            if (expansion == 0 || expansion == 1) {
            } else if (expansion == 0 || expansion == 1) {
                updateStates();
            }
        }
        mLastTracking = tracking;
    }

    /**
@@ -595,6 +585,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb
        if (bouncerShowing != mLastBouncerShowing || mFirstUpdate) {
            mStatusBarWindowManager.setBouncerShowing(bouncerShowing);
            mStatusBar.setBouncerShowing(bouncerShowing);
            if (bouncerShowing) {
                mBouncer.onFullyShown();
            } else {
                mBouncer.onFullyHidden();
            }
        }

        KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext);
+8 −0
Original line number Diff line number Diff line
@@ -167,10 +167,18 @@ public class KeyguardBouncerTest extends SysuiTestCase {

    @Test
    public void testOnFullyShown_notifiesFalsingManager() {
        mBouncer.ensureView();
        mBouncer.onFullyShown();
        verify(mFalsingManager).onBouncerShown();
    }

    @Test
    public void testOnFullyShown_notifiesKeyguardView() {
        mBouncer.ensureView();
        mBouncer.onFullyShown();
        verify(mKeyguardHostView).onResume();
    }

    @Test
    public void testOnFullyHidden_notifiesFalsingManager() {
        mBouncer.onFullyHidden();