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

Commit 497fde33 authored by Fengjiang Li's avatar Fengjiang Li Committed by Android (Google) Code Review
Browse files

Merge "Wait for BackgroundThread.getHandler() to be idle to run next...

Merge "Wait for BackgroundThread.getHandler() to be idle to run next WindowManager related test" into main
parents 6355d098 6ec36c22
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -77,6 +77,7 @@ import android.view.InputChannel;
import android.view.SurfaceControl;

import com.android.dx.mockito.inline.extended.StaticMockitoSession;
import com.android.internal.os.BackgroundThread;
import com.android.server.AnimationThread;
import com.android.server.DisplayThread;
import com.android.server.LocalServices;
@@ -553,6 +554,9 @@ public class SystemServicesTestRule implements TestRule {
        // This is a different handler object than the wm.mAnimationHandler above.
        waitHandlerIdle(AnimationThread.getHandler());
        waitHandlerIdle(SurfaceAnimationThread.getHandler());
        // Some binder calls are posted to BackgroundThread.getHandler(), we should wait for them
        // to finish to run next test.
        waitHandlerIdle(BackgroundThread.getHandler());
    }

    static void waitHandlerIdle(Handler handler) {