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

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

Change-Id: I417fa2d59a15b3254dec9da211ed90d2892508a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Sudheer Shanka
2023-05-22 19:47:33 +00:00
committed by Automerger Merge Worker
2 changed files with 4 additions and 3 deletions

View File

@@ -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();
} }

View File

@@ -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);
} }