Merge "Clear controls and animations in temp arrays after using them" into sc-dev

This commit is contained in:
Tiger Huang
2021-04-09 17:07:15 +00:00
committed by Android (Google) Code Review

View File

@@ -601,8 +601,6 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
return; return;
} }
mTmpFinishedControls.clear();
mTmpRunningAnims.clear();
InsetsState state = new InsetsState(mState, true /* copySources */); InsetsState state = new InsetsState(mState, true /* copySources */);
for (int i = mRunningAnimations.size() - 1; i >= 0; i--) { for (int i = mRunningAnimations.size() - 1; i >= 0; i--) {
RunningAnimation runningAnimation = mRunningAnimations.get(i); RunningAnimation runningAnimation = mRunningAnimations.get(i);
@@ -635,10 +633,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
anim.getTypeMask(), anim.getInterpolatedFraction())); anim.getTypeMask(), anim.getInterpolatedFraction()));
} }
} }
mTmpRunningAnims.clear();
for (int i = mTmpFinishedControls.size() - 1; i >= 0; i--) { for (int i = mTmpFinishedControls.size() - 1; i >= 0; i--) {
dispatchAnimationEnd(mTmpFinishedControls.get(i).getAnimation()); dispatchAnimationEnd(mTmpFinishedControls.get(i).getAnimation());
} }
mTmpFinishedControls.clear();
}; };
} }