From 2292be52c3c8b490a690166cb47a82bf5f341084 Mon Sep 17 00:00:00 2001 From: Beverly Date: Thu, 30 Mar 2023 20:10:36 +0000 Subject: [PATCH] Don't show UDFPS when statusBarState != KEYGUARD However, we allow the UDFPS icon to show when the status bar isn't the keyguard ONLY when the screen off animation is running since the statusBarState is delayed in changing during that time. Previously, we were checking that the device wasn't dozing; however, this was causing the UDFPS icon to flash when a notification was expanded from AOD since the expansion happens when transitioning from DOZE => LS. Fixes: 235170617 Test: atest UdfpsKeyguardViewControllerTest Test: screen off from the home screen, the UDFPS icon fades in on AOD (doesn't blink in) Test: Expand a pulsing notification from AOD, observe there's mistaken show of the UDFPS icon Change-Id: Ifa10b09c3f84045c71614d05eaee28353196b2e3 --- .../biometrics/UdfpsKeyguardViewController.kt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt index 3e7d81a9de901..063b41e8db0f9 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsKeyguardViewController.kt @@ -390,11 +390,14 @@ constructor( return true } - // Only pause auth if we're not on the keyguard AND we're not transitioning to doze - // (ie: dozeAmount = 0f). For the UnlockedScreenOffAnimation, the statusBarState is + // Only pause auth if we're not on the keyguard AND we're not transitioning to doze. + // For the UnlockedScreenOffAnimation, the statusBarState is // delayed. However, we still animate in the UDFPS affordance with the - // mUnlockedScreenOffDozeAnimator. - if (statusBarState != StatusBarState.KEYGUARD && lastDozeAmount == 0f) { + // unlockedScreenOffDozeAnimator. + if ( + statusBarState != StatusBarState.KEYGUARD && + !unlockedScreenOffAnimationController.isAnimationPlaying() + ) { return true } if (isBouncerExpansionGreaterThan(.5f)) {