Merge "Explicitly add "flush-broadcast-loopers" option." into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5835f7d555
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user