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

This commit is contained in:
Sudheer Shanka
2023-05-22 19:23:32 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 3 deletions

View File

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

View File

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