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

Commit df43bc0b authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Clear out all message on WM handler on WindowManagerServiceRule tearDown"

parents eb126b6e ad7faeac
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -173,22 +173,22 @@ public class WindowManagerServiceRule implements TestRule {
        };
    }

    public WindowManagerService getWindowManagerService() {
    WindowManagerService getWindowManagerService() {
        return mService;
    }

    public TestWindowManagerPolicy getWindowManagerPolicy() {
        return mPolicy;
    }

    public void waitUntilWindowManagerHandlersIdle() {
    void waitUntilWindowManagerHandlersIdle() {
        final WindowManagerService wm = getWindowManagerService();
        if (wm != null) {
        if (wm == null) {
            return;
        }
        wm.mH.removeCallbacksAndMessages(null);
        wm.mAnimationHandler.removeCallbacksAndMessages(null);
        SurfaceAnimationThread.getHandler().removeCallbacksAndMessages(null);
        wm.mH.runWithScissors(() -> { }, 0);
        wm.mAnimationHandler.runWithScissors(() -> { }, 0);
        SurfaceAnimationThread.getHandler().runWithScissors(() -> { }, 0);
    }
    }

    private void destroyAllSurfaceTransactions() {
        for (final WeakReference<Transaction> reference : mSurfaceTransactions) {