diff options
author | Justin Klaassen <justinklaassen@google.com> | 2017-10-10 15:20:13 -0400 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2017-10-10 15:20:13 -0400 |
commit | 93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6 (patch) | |
tree | 49f76f879a89c256a4f65b674086be50760bdffb /android/multiuser | |
parent | bc81c7ada5aab3806dd0b17498f5c9672c9b33c4 (diff) | |
download | android-28-93b7ee4fce01df52a6607f0b1965cbafdfeaf1a6.tar.gz |
Import Android SDK Platform P [4386628]
/google/data/ro/projects/android/fetch_artifact \
--bid 4386628 \
--target sdk_phone_armv7-win_sdk \
sdk-repo-linux-sources-4386628.zip
AndroidVersion.ApiLevel has been modified to appear as 28
Change-Id: I9b8400ac92116cae4f033d173f7a5682b26ccba9
Diffstat (limited to 'android/multiuser')
-rw-r--r-- | android/multiuser/BenchmarkRunner.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/android/multiuser/BenchmarkRunner.java b/android/multiuser/BenchmarkRunner.java index c7bebf38..629e6f45 100644 --- a/android/multiuser/BenchmarkRunner.java +++ b/android/multiuser/BenchmarkRunner.java @@ -17,13 +17,16 @@ package android.multiuser; import android.os.Bundle; import android.os.SystemClock; +import android.support.test.InstrumentationRegistry; +import android.support.test.uiautomator.UiDevice; +import java.io.IOException; import java.util.ArrayList; // Based on //platform/frameworks/base/apct-tests/perftests/utils/BenchmarkState.java public class BenchmarkRunner { - private static long COOL_OFF_PERIOD_MS = 2000; + private static final long COOL_OFF_PERIOD_MS = 1000; private static final int NUM_ITERATIONS = 4; @@ -70,9 +73,13 @@ public class BenchmarkRunner { } private void prepareForNextRun() { - // TODO: Once http://b/63115387 is fixed, look into using "am wait-for-broadcast-idle" - // command instead of waiting for a fixed amount of time. SystemClock.sleep(COOL_OFF_PERIOD_MS); + try { + UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()) + .executeShellCommand("am wait-for-broadcast-idle"); + } catch (IOException e) { + throw new IllegalStateException("Cannot execute shell command", e); + } mStartTimeNs = System.nanoTime(); mPausedDurationNs = 0; } |