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

Commit 2d33b092 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Automerger Merge Worker
Browse files

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

Merge "Explicitly add "flush-broadcast-loopers" option." into udc-dev am: 5835f7d5 am: a2757770 am: 9374bf0b

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23328616



Change-Id: I529726c94c9c0a7c00589b730d62a3a014d8543c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2adb667d 9374bf0b
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -80,7 +80,7 @@ public class BenchmarkRunner {


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


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


    private void waitForBroadcastIdle() {
    private void waitForBroadcastIdle() {
        try {
        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) {
        } catch (TimeoutException e) {
            Log.e(TAG, "Ending waitForBroadcastIdle because it is taking too long", e);
            Log.e(TAG, "Ending waitForBroadcastIdle because it is taking too long", e);
        }
        }