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

Commit 6eb0f68b authored by Sudheer Shanka's avatar Sudheer Shanka
Browse files

Explicitly add "flush-broadcast-loopers" option.

Recently, flushing the broadcast loopers behavior, when
"wait-for-broadcast-barrier" command is invoked, is made
optional which resulted in some regressions in multi-user
tests as they same to be relying on flushing the broadcast
loopers behavior. So, explicitly add this option when
invoking the command.

Bug: 282848750
Test: atest android.multiuser.UserLifecycleTests
Change-Id: I6ba4e0858a63653b731c7a24b600ce9af758d39c
parent 31781318
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);
        }