summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2016-08-27 15:33:16 -0700
committerSunny Goyal <sunnygoyal@google.com>2016-08-30 11:04:25 -0700
commita2125e1d102034e1d638b5d1e973b5b77cfe1efd (patch)
tree5cfaefa947ad2c86da4d9810341120c126aed79e /tests
parent4a4b49ff3482cbe7f8192807cdc99437810fe518 (diff)
downloadandroid_packages_apps_Trebuchet-a2125e1d102034e1d638b5d1e973b5b77cfe1efd.tar.gz
android_packages_apps_Trebuchet-a2125e1d102034e1d638b5d1e973b5b77cfe1efd.tar.bz2
android_packages_apps_Trebuchet-a2125e1d102034e1d638b5d1e973b5b77cfe1efd.zip
Bug fix in Alarm where it was not getting called correctly if the
new timeout was set that was smaller than the previously set timeout > Using uptimeMillis in Alarm to avoid errors due to system time changes > Adding an extra check in Wait in case Thread.sleep eats up all the timeout Change-Id: Id1fac5e8fdb81a0c3c7a6a5e50586b2a2f180d06
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/launcher3/util/Wait.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/src/com/android/launcher3/util/Wait.java b/tests/src/com/android/launcher3/util/Wait.java
index 02a19137e..f9e53ba8b 100644
--- a/tests/src/com/android/launcher3/util/Wait.java
+++ b/tests/src/com/android/launcher3/util/Wait.java
@@ -25,6 +25,15 @@ public class Wait {
}
SystemClock.sleep(sleepMillis);
}
+
+ // Check once more before returning false.
+ try {
+ if (condition.isTrue()) {
+ return true;
+ }
+ } catch (Throwable t) {
+ // Ignore
+ }
return false;
}
}