Small fix to PollingCheck
Reduce sleep time, and check condition
before sleeping first time.
Change-Id: I8984b57aed4a99662b015518bd5b33f2aa273d40
diff --git a/tests/src/android/cts/util/PollingCheck.java b/tests/src/android/cts/util/PollingCheck.java
index 934feea..8870fb9 100644
--- a/tests/src/android/cts/util/PollingCheck.java
+++ b/tests/src/android/cts/util/PollingCheck.java
@@ -19,7 +19,7 @@
import junit.framework.Assert;
public abstract class PollingCheck {
- private static final long TIME_SLICE = 200;
+ private static final long TIME_SLICE = 50;
private long mTimeout = 3000;
public PollingCheck() {
@@ -32,6 +32,10 @@
protected abstract boolean check();
public void run() {
+ if (check()) {
+ return;
+ }
+
long timeout = mTimeout;
while (timeout > 0) {
try {