diff options
| -rw-r--r-- | apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java index 448ee6160ce0..40a3c9292574 100644 --- a/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java +++ b/apct-tests/perftests/multiuser/src/android/multiuser/UserLifecycleTests.java @@ -316,6 +316,8 @@ public class UserLifecycleTests { mIam.startUserInBackground(userId); }, Intent.ACTION_USER_STARTED, Intent.ACTION_MEDIA_MOUNTED); + waitForBroadcastIdle(); + mRunner.resumeTiming(); Log.i(TAG, "Starting timer"); @@ -678,6 +680,8 @@ public class UserLifecycleTests { } private void stopUser(int userId, boolean force) throws RemoteException { + waitForBroadcastIdle(); + final CountDownLatch latch = new CountDownLatch(1); mIam.stopUser(userId, force /* force */, new IStopUserCallback.Stub() { @Override @@ -882,4 +886,8 @@ public class UserLifecycleTests { assertEquals("", ShellHelper.runShellCommand("setprop " + name + " " + value)); return oldValue; } + + private void waitForBroadcastIdle() { + ShellHelper.runShellCommand("am wait-for-broadcast-idle"); + } } |