Loading apct-tests/perftests/multiuser/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_STATIC_JAVA_LIBRARIES := \ android-support-test android-support-test \ ub-uiautomator LOCAL_PACKAGE_NAME := MultiUserPerfTests Loading apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkRunner.java +10 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading Loading
apct-tests/perftests/multiuser/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -20,7 +20,8 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := $(call all-java-files-under, src) LOCAL_STATIC_JAVA_LIBRARIES := \ android-support-test android-support-test \ ub-uiautomator LOCAL_PACKAGE_NAME := MultiUserPerfTests Loading
apct-tests/perftests/multiuser/src/android/multiuser/BenchmarkRunner.java +10 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; } Loading