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

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

Merge "Clean up AnimationThread default handler"

parents 847872c5 c9dfbc5f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ class SystemServiceTestsBase {
        mLockRule.waitForLocked(mSystemServicesTestRule::waitUntilWindowManagerHandlersIdle);
    }

    void cleanupWindowManagerHandlers() {
        mLockRule.waitForLocked(mSystemServicesTestRule::cleanupWindowManagerHandlers);
    }

    boolean waitHandlerIdle(Handler handler) {
        return waitHandlerIdle(handler, 0 /* timeout */);
    }
+4 −0
Original line number Diff line number Diff line
@@ -355,6 +355,8 @@ public class SystemServicesTestRule implements TestRule {
        }
        wm.mH.removeCallbacksAndMessages(null);
        wm.mAnimationHandler.removeCallbacksAndMessages(null);
        // This is a different handler object than the wm.mAnimationHandler above.
        AnimationThread.getHandler().removeCallbacksAndMessages(null);
        SurfaceAnimationThread.getHandler().removeCallbacksAndMessages(null);
    }

@@ -367,6 +369,8 @@ public class SystemServicesTestRule implements TestRule {
        wm.mH.removeMessages(WindowManagerService.H.FORCE_GC);
        waitHandlerIdle(wm.mH);
        waitHandlerIdle(wm.mAnimationHandler);
        // This is a different handler object than the wm.mAnimationHandler above.
        waitHandlerIdle(AnimationThread.getHandler());
        waitHandlerIdle(SurfaceAnimationThread.getHandler());
    }

+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ class WindowTestsBase extends SystemServiceTestsBase {
            }

            // Cleaned up everything in Handler.
            mSystemServicesTestRule.cleanupWindowManagerHandlers();
            cleanupWindowManagerHandlers();
        } catch (Exception e) {
            Log.e(TAG, "Failed to tear down test", e);
            throw e;