Fix SpringAnimation class cast exception.

this is a hot fix for the regression caused by ag/20171590, may need more investigation to properly handle it.

Bug: 255723033
Test: Failing Tests
Change-Id: I129f69d2979405b33c8b46430c7b1ec8559105aa
This commit is contained in:
Yein Jo
2022-10-31 23:19:33 +00:00
parent ef6a85b104
commit 4440afb935

View File

@@ -219,12 +219,14 @@ public class AnimationHandler {
return;
}
for (int i = 0; i < mAnimationCallbacks.size(); ++i) {
Animator animator = ((Animator) mAnimationCallbacks.get(i));
if (animator != null
&& animator.getTotalDuration() == Animator.DURATION_INFINITE
&& !animator.isPaused()) {
mPausedAnimators.add(animator);
animator.pause();
AnimationFrameCallback callback = mAnimationCallbacks.get(i);
if (callback instanceof Animator) {
Animator animator = ((Animator) callback);
if (animator.getTotalDuration() == Animator.DURATION_INFINITE
&& !animator.isPaused()) {
mPausedAnimators.add(animator);
animator.pause();
}
}
}
};