Merge "Ensure end action is called if keyguard animation is cancelled" into sc-qpr1-dev

This commit is contained in:
TreeHugger Robot
2021-11-02 15:45:20 +00:00
committed by Android (Google) Code Review

View File

@@ -145,14 +145,15 @@ class UnlockedScreenOffAnimationController @Inject constructor(
.setDuration(duration.toLong()) .setDuration(duration.toLong())
.setInterpolator(Interpolators.FAST_OUT_SLOW_IN) .setInterpolator(Interpolators.FAST_OUT_SLOW_IN)
.alpha(1f) .alpha(1f)
.withEndAction { .setListener(object : AnimatorListenerAdapter() {
override fun onAnimationEnd(animation: Animator?) {
aodUiAnimationPlaying = false aodUiAnimationPlaying = false
// Lock the keyguard if it was waiting for the screen off animation to end. // Lock the keyguard if it was waiting for the screen off animation to end.
keyguardViewMediatorLazy.get().maybeHandlePendingLock() keyguardViewMediatorLazy.get().maybeHandlePendingLock()
// Tell the StatusBar to become keyguard for real - we waited on that since it // Tell the StatusBar to become keyguard for real - we waited on that since
// is slow and would have caused the animation to jank. // it is slow and would have caused the animation to jank.
statusBar.updateIsKeyguard() statusBar.updateIsKeyguard()
// Run the callback given to us by the KeyguardVisibilityHelper. // Run the callback given to us by the KeyguardVisibilityHelper.
@@ -160,7 +161,11 @@ class UnlockedScreenOffAnimationController @Inject constructor(
// Done going to sleep, reset this flag. // Done going to sleep, reset this flag.
decidedToAnimateGoingToSleep = null decidedToAnimateGoingToSleep = null
// We need to unset the listener. These are persistent for future animators
keyguardView.animate().setListener(null)
} }
})
.start() .start()
} }