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

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

Merge "Make sure udfps bouncer always shows when requested" into sc-qpr1-dev am: 40b77ace

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

Change-Id: I1eff6b80ca6a2a5a82f587e3c725117fdbf8f324
parents e130b512 40b77ace
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -287,7 +287,9 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud
                : (int) MathUtils.constrain(
                    MathUtils.map(.5f, .9f, 0f, 255f, expansion),
                    0f, 255f);
        if (!mShowingUdfpsBouncer) {
            alpha *= (1.0f - mTransitionToFullShadeProgress);
        }
        mView.setUnpausedAlpha(alpha);
    }

+35 −1
Original line number Diff line number Diff line
@@ -384,7 +384,41 @@ public class UdfpsKeyguardViewControllerTest extends SysuiTestCase {
        // WHEN status bar expansion is 0 but udfps bouncer is requested
        mAltAuthInterceptor.showAlternateAuthBouncer();

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

    @Test
    public void testTransitionToFullShadeProgress() {
        // GIVEN view is attached and status bar expansion is 1f
        mController.onViewAttached();
        captureExpansionListeners();
        updateStatusBarExpansion(1f, true);
        reset(mView);

        // WHEN we're transitioning to the full shade
        float transitionProgress = .6f;
        mController.setTransitionToFullShadeProgress(transitionProgress);

        // THEN alpha is between 0 and 255
        verify(mView).setUnpausedAlpha((int) ((1f - transitionProgress) * 255));
    }

    @Test
    public void testShowUdfpsBouncer_transitionToFullShadeProgress() {
        // GIVEN view is attached and status bar expansion is 1f
        mController.onViewAttached();
        captureExpansionListeners();
        captureKeyguardStateControllerCallback();
        captureAltAuthInterceptor();
        updateStatusBarExpansion(1f, true);
        mAltAuthInterceptor.showAlternateAuthBouncer();
        reset(mView);

        // WHEN we're transitioning to the full shade
        mController.setTransitionToFullShadeProgress(1.0f);

        // THEN alpha is 255 (b/c udfps bouncer is requested)
        verify(mView).setUnpausedAlpha(255);
    }