diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-10-01 05:42:25 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-10-01 05:42:25 +0000 |
commit | 68ce14ffa144572a6f044b24dcd7ea0eb0c3be33 (patch) | |
tree | 33fabe9291ab56736177c97c4aadb2099cb78155 | |
parent | f0cb13f8004cb8380d9ee268425b6f1bd2d212e4 (diff) | |
parent | 87c9be07a7589d0873d7212e30ac94052609677b (diff) | |
download | base-68ce14ffa144572a6f044b24dcd7ea0eb0c3be33.tar.gz |
Merge cherrypicks of [15957043, 15950420, 15957044] into sc-d1-release
Change-Id: I14ed4818a52568b3b0df326fa769fed21aa7d67c
2 files changed, 38 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java index bf2eb5cedcc0..888672316c8a 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java @@ -264,7 +264,9 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud : (int) MathUtils.constrain( MathUtils.map(.5f, .9f, 0f, 255f, expansion), 0f, 255f); - alpha *= (1.0f - mTransitionToFullShadeProgress); + if (!mShowingUdfpsBouncer) { + alpha *= (1.0f - mTransitionToFullShadeProgress); + } mView.setUnpausedAlpha(alpha); } diff --git a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java index 5eb913856187..0fbf9af159a6 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/biometrics/UdfpsKeyguardViewControllerTest.java @@ -328,7 +328,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); } |