StatusBar unfold transition: reset translations when rotating

When rotating the screen scoped status bar unfold
transition provider stops the animation and invokes
onTransitionFinished callback but the translations of the
views are not cleared. It led to incorrect translations
of the status bar icons after rotating the screen during
the animation.

Bug: 201518277
Test: rotate the phone during unfold animation
Change-Id: I3bcd48f73e43133e3d53c7ba9f25e9618a037d4c
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt
index 2707fa3..8ef186c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarMoveFromCenterAnimationController.kt
@@ -63,5 +63,11 @@
         override fun onTransitionProgress(progress: Float) {
             moveFromCenterAnimator?.onTransitionProgress(progress)
         }
+
+        override fun onTransitionFinished() {
+            // Reset translations when transition is stopped/cancelled
+            // (e.g. the transition could be cancelled mid-way when rotating the screen)
+            moveFromCenterAnimator?.onTransitionProgress(1f)
+        }
     }
 }