Add the ability to adjust the timing animation end listener
No behavior change unless someone enables this. Originally, when calling onAnimationEnd, the listeners are called before drawing the last animation frame. If the listener is slow, there may have jank at the end of animation. If setPostNotifyEndListenerEnabled is enabled, the most common animators: ValueAnimator and AnimatorSet will run the end listeners on the next frame of last animation frame. So the implementation of callback won't delay the animation frame. Also make FrameTracker exclude the frame of end callback from jank data if it is the frame after the last animation frame. Bug: 300035126 Flag: EXEMPT disabled by default Test: atest FrameworksCoreTests:FrameTrackerTest# \ testEndAnimationWithLastFrameSyncId atest FrameworksCoreTests:ValueAnimatorTests# \ testPostNotifyEndListener Change-Id: I0550d951c65fe0e03e81bce883b3b33a796ae532
Loading
Please register or sign in to comment