diff options
| author | 2021-11-15 21:25:11 +0000 | |
|---|---|---|
| committer | 2021-11-15 21:25:11 +0000 | |
| commit | cb4a25f6dffcab62b0eee48af38bba0ce2f72d81 (patch) | |
| tree | f452944d736fc43d458057c2181ef92bd124029a | |
| parent | 83334b67a2dca6900fb61b0a24b656754417c606 (diff) | |
| parent | 1267a8ffa5288244bf53c4a7979556423bc9c0d4 (diff) | |
Merge "Fix UDFPS not working when a HUN is showing" into sc-v2-dev
3 files changed, 9 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationView.java index 1f11894de55e..e7f637421a4d 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationView.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationView.java @@ -111,7 +111,7 @@ abstract class UdfpsAnimationView extends FrameLayout { return (int) ((1 - percent) * 255); } - public void onExpansionChanged(float expansion, boolean expanded) { + public void onExpansionChanged(float expansion) { mAlpha = expansionToAlpha(expansion); updateAlpha(); } diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java index 94743407f03d..fb4616a832dc 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsAnimationViewController.java @@ -46,7 +46,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> @NonNull final PanelExpansionStateManager mPanelExpansionStateManager; @NonNull final DumpManager mDumpManger; - boolean mNotificationShadeExpanded; + boolean mNotificationShadeVisible; protected UdfpsAnimationViewController( T view, @@ -85,7 +85,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { - pw.println("mNotificationShadeExpanded=" + mNotificationShadeExpanded); + pw.println("mNotificationShadeVisible=" + mNotificationShadeVisible); pw.println("shouldPauseAuth()=" + shouldPauseAuth()); pw.println("isPauseAuth=" + mView.isPauseAuth()); } @@ -95,7 +95,7 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> * authentication. */ boolean shouldPauseAuth() { - return mNotificationShadeExpanded; + return mNotificationShadeVisible; } /** @@ -182,8 +182,10 @@ abstract class UdfpsAnimationViewController<T extends UdfpsAnimationView> @Override public void onPanelExpansionChanged( float fraction, boolean expanded, boolean tracking) { - mNotificationShadeExpanded = expanded; - mView.onExpansionChanged(fraction, expanded); + // Notification shade can be expanded but not visible (fraction: 0.0), for example + // when a heads-up notification (HUN) is showing. + mNotificationShadeVisible = expanded && fraction > 0f; + mView.onExpansionChanged(fraction); updatePauseAuth(); } }; diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java index d1ea45cac081..223eb78044c4 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.java @@ -211,7 +211,7 @@ public class UdfpsKeyguardViewController extends UdfpsAnimationViewController<Ud return false; } - if (mUdfpsRequested && !mNotificationShadeExpanded + if (mUdfpsRequested && !mNotificationShadeVisible && (!mIsBouncerVisible || mInputBouncerHiddenAmount != KeyguardBouncer.EXPANSION_VISIBLE)) { return false; |