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

Commit 4ae5386a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Update unpaused udfps alpha when showing udfps bouncer" into...

Merge "Update unpaused udfps alpha when showing udfps bouncer" into sc-qpr1-dev am: 2747904e am: dbc02859 am: 24abf949

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15693008

Change-Id: I8a9f972febe99996ef2f0db31503dcf08fac4bad
parents 472d5145 24abf949
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -155,6 +155,13 @@ public class UdfpsKeyguardView extends UdfpsAnimationView {
        updateAlpha();
    }

    /**
     * @return alpha between 0 and 255
     */
    int getUnpausedAlpha() {
        return mAlpha;
    }

    @Override
    protected int updateAlpha() {
        int alpha = super.updateAlpha();
+6 −3
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
        pw.println("mIsBouncerVisible=" + mIsBouncerVisible);
        pw.println("mInputBouncerHiddenAmount=" + mInputBouncerHiddenAmount);
        pw.println("mStatusBarExpansion=" + mStatusBarExpansion);
        pw.println("mAlpha=" + mView.getAlpha());
        pw.println("unpausedAlpha=" + mView.getUnpausedAlpha());
        pw.println("mUdfpsRequested=" + mUdfpsRequested);
        pw.println("mView.mUdfpsRequested=" + mView.mUdfpsRequested);
        pw.println("mLaunchTransitionFadingAway=" + mLaunchTransitionFadingAway);
@@ -183,13 +183,13 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
            return false;
        }

        boolean udfpsAffordanceWasNotShowing = shouldPauseAuth();
        mShowingUdfpsBouncer = show;
        if (mShowingUdfpsBouncer) {
            mLastUdfpsBouncerShowTime = mSystemClock.uptimeMillis();
        }
        updatePauseAuth();
        if (mShowingUdfpsBouncer) {
            if (mStatusBarState == StatusBarState.SHADE_LOCKED) {
            if (udfpsAffordanceWasNotShowing) {
                mView.animateInUdfpsBouncer(null);
            }

@@ -202,6 +202,8 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
        } else {
            mKeyguardUpdateMonitor.requestFaceAuthOnOccludingApp(false);
        }
        updateAlpha();
        updatePauseAuth();
        return true;
    }

@@ -335,6 +337,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                public void requestUdfps(boolean request, int color) {
                    mUdfpsRequested = request;
                    mView.requestUdfps(request, color);
                    updateAlpha();
                    updatePauseAuth();
                }

+19 −0
Original line number Diff line number Diff line
@@ -369,6 +369,25 @@ public class UdfpsKeyguardViewControllerTest extends SysuiTestCase {
        verify(mView).setUnpausedAlpha(0);
    }

    @Test
    public void testShowUdfpsBouncer() {
        // GIVEN view is attached and status bar expansion is 0
        mController.onViewAttached();
        captureExpansionListeners();
        captureKeyguardStateControllerCallback();
        captureAltAuthInterceptor();
        updateStatusBarExpansion(0, true);
        reset(mView);
        when(mView.getContext()).thenReturn(mResourceContext);
        when(mResourceContext.getString(anyInt())).thenReturn("test string");

        // WHEN status bar expansion is 0 but udfps bouncer is requested
        mAltAuthInterceptor.showAlternateAuthBouncer();

        // THEN alpha is 0
        verify(mView).setUnpausedAlpha(255);
    }

    private void sendStatusBarStateChanged(int statusBarState) {
        mStatusBarStateListener.onStateChanged(statusBarState);
    }