Don't notify animation finished if no animation
This removes commit ab9fcb21 to avoid potential recursion of surface placement: onAnimationFinished -> onExitAnimationDone -> destroySurfaces -> postWindowRemoveCleanupLocked -> performSurfacePlacementNoTrace. The original case no longer occurs without the invocation. And now the window with mRemoveOnExit=true will be removed by WindowState #handleCompleteDeferredRemoval. And if there is only mAnimatingExit, it will be handled by WS#cleanupAnimatingExitWindow. The test testStuckExitingWindow is also removed because no matter with calling onAnimationFinished or not in postApplyAnimation, the test always passes. Verified the original issue case: change language and swipe up. There is no leftover EXITING window. Even hardcode to set the exit flags unexpectedly, there is still no problem. Bug: 237481770 Test: WindowStateTests#testDeferredRemovalByAnimating WindowContainerTests#testHandleCompleteDeferredRemoval Change-Id: If10cd3c334476e078fdd4d4db05bf8b37db84ccc
Loading
Please register or sign in to comment