diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt index 33126b3887da7..76c1dbcaf20c7 100644 --- a/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt +++ b/packages/SystemUI/src/com/android/systemui/biometrics/AuthRippleController.kt @@ -145,6 +145,7 @@ class AuthRippleController @Inject constructor( val lightRevealScrim = centralSurfaces.lightRevealScrim if (statusBarStateController.isDozing || biometricUnlockController.isWakeAndUnlock) { circleReveal?.let { + lightRevealScrim?.revealAmount = 0f lightRevealScrim?.revealEffect = it startLightRevealScrimOnKeyguardFadingAway = true } @@ -168,7 +169,8 @@ class AuthRippleController @Inject constructor( startDelay = keyguardStateController.keyguardFadingAwayDelay addUpdateListener { animator -> if (lightRevealScrim.revealEffect != circleReveal) { - // if something else took over the reveal, let's do nothing. + // if something else took over the reveal, let's cancel ourselves + cancel() return@addUpdateListener } lightRevealScrim.revealAmount = animator.animatedValue as Float diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt b/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt index 9a932bae833e8..270bdc785178a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/LightRevealScrim.kt @@ -11,6 +11,7 @@ import android.graphics.PorterDuffColorFilter import android.graphics.PorterDuffXfermode import android.graphics.RadialGradient import android.graphics.Shader +import android.os.Trace import android.util.AttributeSet import android.util.MathUtils.lerp import android.view.View @@ -222,6 +223,8 @@ class LightRevealScrim(context: Context?, attrs: AttributeSet?) : View(context, revealEffect.setRevealAmountOnScrim(value, this) updateScrimOpaque() + Trace.traceCounter(Trace.TRACE_TAG_APP, "light_reveal_amount", + (field * 100).toInt()) invalidate() } } @@ -355,8 +358,8 @@ class LightRevealScrim(context: Context?, attrs: AttributeSet?) : View(context, } override fun onDraw(canvas: Canvas?) { - if (canvas == null || revealGradientWidth <= 0 || revealGradientHeight <= 0 - || revealAmount == 0f) { + if (canvas == null || revealGradientWidth <= 0 || revealGradientHeight <= 0 || + revealAmount == 0f) { if (revealAmount < 1f) { canvas?.drawColor(revealGradientEndColor) } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java index c77b0d6721fb6..5e81b5da24558 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfaces.java @@ -4404,8 +4404,7 @@ public class CentralSurfaces extends CoreStartable implements @Override public void onDozeAmountChanged(float linear, float eased) { if (mFeatureFlags.isEnabled(Flags.LOCKSCREEN_ANIMATIONS) - && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal) - && !mBiometricUnlockController.isWakeAndUnlock()) { + && !(mLightRevealScrim.getRevealEffect() instanceof CircleReveal)) { mLightRevealScrim.setRevealAmount(1f - linear); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt index ea935be334c17..935f87dc82218 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt @@ -17,6 +17,7 @@ import com.android.systemui.animation.Interpolators import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.KeyguardViewMediator import com.android.systemui.keyguard.WakefulnessLifecycle +import com.android.systemui.statusbar.CircleReveal import com.android.systemui.statusbar.LightRevealScrim import com.android.systemui.statusbar.StatusBarState import com.android.systemui.statusbar.StatusBarStateControllerImpl @@ -85,7 +86,9 @@ class UnlockedScreenOffAnimationController @Inject constructor( duration = LIGHT_REVEAL_ANIMATION_DURATION interpolator = Interpolators.LINEAR addUpdateListener { - lightRevealScrim.revealAmount = it.animatedValue as Float + if (lightRevealScrim.revealEffect !is CircleReveal) { + lightRevealScrim.revealAmount = it.animatedValue as Float + } if (lightRevealScrim.isScrimAlmostOccludes && interactionJankMonitor.isInstrumenting(CUJ_SCREEN_OFF)) { // ends the instrument when the scrim almost occludes the screen. @@ -95,9 +98,9 @@ class UnlockedScreenOffAnimationController @Inject constructor( } addListener(object : AnimatorListenerAdapter() { override fun onAnimationCancel(animation: Animator?) { - lightRevealScrim.revealAmount = 1f - lightRevealAnimationPlaying = false - interactionJankMonitor.cancel(CUJ_SCREEN_OFF) + if (lightRevealScrim.revealEffect !is CircleReveal) { + lightRevealScrim.revealAmount = 1f + } } override fun onAnimationEnd(animation: Animator?) {