summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt26
1 files changed, 14 insertions, 12 deletions
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 fdc0ec5b9089..e2332e923aa4 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UnlockedScreenOffAnimationController.kt
@@ -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()
}