Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e78ae7e authored by Joshua Tsuji's avatar Joshua Tsuji
Browse files

Clear out position-specific end actions in clearAnimator().

Previously, these were cleared in onAnimationEnd. This meant that any non-position animations started while a position animation was in progress would end up using leftover end actions, resulting in undefined behavior.

Fixes: 137201711
Test: atest SystemUITests
Change-Id: I19c2e847ae29681b30123afdf6e1e8f7a13e52ef
parent 41346ef1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ public class PhysicsAnimationLayout extends FrameLayout {
         * End actions to call when both TRANSLATION_X and TRANSLATION_Y animations have completed,
         * if {@link #position} was used to animate TRANSLATION_X and TRANSLATION_Y simultaneously.
         */
        private Runnable[] mPositionEndActions;
        @Nullable private Runnable[] mPositionEndActions;

        /**
         * All of the properties that have been set and will animate when {@link #start} is called.
@@ -1086,6 +1086,7 @@ public class PhysicsAnimationLayout extends FrameLayout {
            mDampingRatio = -1;
            mEndActionsForProperty.clear();
            mPathAnimator = null;
            mPositionEndActions = null;
        }

        /**