Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5acec68d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Cancel all pending anims when tearing down."

parents 1636a9d8 eb629d7e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -164,6 +164,7 @@ public class WindowManagerServiceRule implements TestRule {
            }

            private void tearDown() {
                cancelAllPendingAnimations();
                waitUntilWindowManagerHandlersIdle();
                destroyAllSurfaceTransactions();
                destroyAllSurfaceControls();
@@ -178,6 +179,15 @@ public class WindowManagerServiceRule implements TestRule {
        return mService;
    }

    private void cancelAllPendingAnimations() {
        for (final WeakReference<SurfaceControl> reference : mSurfaceControls) {
            final SurfaceControl sc = reference.get();
            if (sc != null) {
                mService.mSurfaceAnimationRunner.onAnimationCancelled(sc);
            }
        }
    }

    void waitUntilWindowManagerHandlersIdle() {
        final WindowManagerService wm = getWindowManagerService();
        if (wm == null) {