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

Commit bca1de6a authored by Ioana Alexandru's avatar Ioana Alexandru
Browse files

Fix waitForIdleSync not working with robolectric

Fix: 355376968
Test: run waitForIdleSync from a deviceless test
Flag: TEST_ONLY

Change-Id: I482acd0d92b496848398cf378d6e9e7a7a3b3bd1
parent 1aa48f9e
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -271,11 +271,15 @@ public abstract class SysuiTestCase {
    }

    protected void waitForIdleSync() {
        if (isRobolectricTest()) {
            mRealInstrumentation.waitForIdleSync();
        } else {
            if (mHandler == null) {
                mHandler = new Handler(Looper.getMainLooper());
            }
            waitForIdleSync(mHandler);
        }
    }

    protected void waitForUiOffloadThread() {
        Future<?> future = Dependency.get(UiOffloadThread.class).execute(() -> { });