Merge "Wait for broadcast idle before runThenWaits containing resumeTiming."
This commit is contained in:
committed by
Android (Google) Code Review
commit
d44f580e9b
@@ -208,6 +208,8 @@ public class UserLifecycleTests {
|
||||
while (mRunner.keepRunning()) {
|
||||
mRunner.pauseTiming();
|
||||
final int userId = createUserNoFlags();
|
||||
|
||||
waitForBroadcastIdle();
|
||||
runThenWaitForBroadcasts(userId, () -> {
|
||||
mRunner.resumeTiming();
|
||||
Log.i(TAG, "Starting timer");
|
||||
@@ -335,6 +337,7 @@ public class UserLifecycleTests {
|
||||
final int startUser = mAm.getCurrentUser();
|
||||
final int userId = createUserNoFlags();
|
||||
|
||||
waitForBroadcastIdle();
|
||||
mUserSwitchWaiter.runThenWaitUntilBootCompleted(userId, () -> {
|
||||
mRunner.resumeTiming();
|
||||
Log.i(TAG, "Starting timer");
|
||||
@@ -360,6 +363,7 @@ public class UserLifecycleTests {
|
||||
switchUser(userId);
|
||||
}, Intent.ACTION_MEDIA_MOUNTED);
|
||||
|
||||
waitForBroadcastIdle();
|
||||
mUserSwitchWaiter.runThenWaitUntilSwitchCompleted(startUser, () -> {
|
||||
runThenWaitForBroadcasts(userId, () -> {
|
||||
mRunner.resumeTiming();
|
||||
@@ -685,7 +689,7 @@ public class UserLifecycleTests {
|
||||
*/
|
||||
private void stopUserAfterWaitingForBroadcastIdle(int userId, boolean force)
|
||||
throws RemoteException {
|
||||
ShellHelper.runShellCommand("am wait-for-broadcast-idle");
|
||||
waitForBroadcastIdle();
|
||||
stopUser(userId, force);
|
||||
}
|
||||
|
||||
@@ -894,4 +898,8 @@ public class UserLifecycleTests {
|
||||
assertEquals("", ShellHelper.runShellCommand("setprop " + name + " " + value));
|
||||
return oldValue;
|
||||
}
|
||||
|
||||
private void waitForBroadcastIdle() {
|
||||
ShellHelper.runShellCommand("am wait-for-broadcast-idle");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user