Ensure end action is called if keyguard animation is cancelled

Else, the dozing state may be inaccurate which will
cause aod-buggyness

Test: manual, builds and transition to AOD still works
Bug: 202630143
Change-Id: I57af55792db76552d3f991204b185a9472abea58
This commit is contained in:
Beverly
2021-10-21 16:20:25 -04:00
committed by Beverly Tai
parent e5a6127d6d
commit 0f63fa265b

View File

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