Merge "Ensure end action is called if keyguard animation is cancelled" into sc-v2-dev am: 517f6aedc1

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16103094

Change-Id: Iffbb13f1b57037a5d8e5395ba1b4720052942aba
This commit is contained in:
TreeHugger Robot
2021-10-23 02:30:29 +00:00
committed by Automerger Merge Worker

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.
@@ -161,6 +162,7 @@ class UnlockedScreenOffAnimationController @Inject constructor(
// Done going to sleep, reset this flag. // Done going to sleep, reset this flag.
decidedToAnimateGoingToSleep = null decidedToAnimateGoingToSleep = null
} }
})
.start() .start()
} }