Fix pinned stack destination been overwrite by obsolete animator.
There is a race condition when an app leave from landscape mode and enter pinned stack in portrait mode. First racer is that TaskStack will post animateBounds to animation thread, the second is #onConfigurationChanged will ask TaskStack to update new stack bounds if needed. When the first animation executed, it will call TaskStack#onAnimationEnd then #setPinnedStackSize, however, this bounds may already obsoleted if configuration changed happen after first animation is posted. To fix this issue, we can cancel the existing animator via verifying the final destination, and prevent animator set obsoleted bounds back if the animation is canceled. Fix: 129723312 Test: Try reproduce this issue over 100+ times. Test: atest ActivityManagerPinnedStackTests Test: atest BoundsAnimationControllerTests Change-Id: I5d42cbe576e7683b22679b1e97be07063c2a05d6
Loading
Please register or sign in to comment