Fix an issue with canceling a PhysicsAnimator
- Canceling was previously missing some endAction calls due to the
properties changing mid-iteration
- In particular:
- cancel() calls cancelAction with springAnimations.keys
- cancelInternal() would then iterate through each property and
calling cancel() on the associated animation in order
- however, the endListener set in configureDynamicAnimation()
will call onInternalAnimationEnd on the internal listeners and
then remove the property from springAnimations. This changes
the list that we are currently iterating in cancelInternal()
so the iterator is invalid (next() returns a null property which
is silently missed because of the inline null check)
Bug: 419081119
Flag: EXEMPT bugfix
Test: atest PhysicsAnimatorTest
Change-Id: I84254b388954a7fdd531507c37c432a27cd0d770
1 file changed