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

Commit 5835f7d5 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Explicitly add "flush-broadcast-loopers" option." into udc-dev

parents a7ba7d7f 6eb0f68b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public class BenchmarkRunner {

    private void prepareForNextRun() {
        SystemClock.sleep(COOL_OFF_PERIOD_MS);
        ShellHelper.runShellCommand("am wait-for-broadcast-idle");
        ShellHelper.runShellCommand("am wait-for-broadcast-idle --flush-broadcast-loopers");
        mStartTimeNs = System.nanoTime();
        mPausedDurationNs = 0;
    }
@@ -102,7 +102,7 @@ public class BenchmarkRunner {
     * to avoid unnecessary waiting.
     */
    public void resumeTiming() {
        ShellHelper.runShellCommand("am wait-for-broadcast-idle");
        ShellHelper.runShellCommand("am wait-for-broadcast-idle --flush-broadcast-loopers");
        resumeTimer();
    }

+2 −1
Original line number Diff line number Diff line
@@ -1541,7 +1541,8 @@ public class UserLifecycleTests {

    private void waitForBroadcastIdle() {
        try {
            ShellHelper.runShellCommandWithTimeout("am wait-for-broadcast-idle", TIMEOUT_IN_SECOND);
            ShellHelper.runShellCommandWithTimeout(
                    "am wait-for-broadcast-idle --flush-broadcast-loopers", TIMEOUT_IN_SECOND);
        } catch (TimeoutException e) {
            Log.e(TAG, "Ending waitForBroadcastIdle because it is taking too long", e);
        }