summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCostin Manolache <costin@google.com>2011-07-15 11:20:42 -0700
committerCostin Manolache <costin@google.com>2011-07-17 14:35:29 -0700
commitb0935343e835b7cbd785e8b888e3909d5932bdd1 (patch)
tree1cbc911d1d373c6d779125b3a99d9218af2d9bfb
parent47b779b9f9c2e7948ae8d45ea07a10f1ad07d135 (diff)
downloadframeworks_base-b0935343e835b7cbd785e8b888e3909d5932bdd1.zip
frameworks_base-b0935343e835b7cbd785e8b888e3909d5932bdd1.tar.gz
frameworks_base-b0935343e835b7cbd785e8b888e3909d5932bdd1.tar.bz2
waitWithTimeout() needs to check if the result is already available, like waitForActivity() does.
Change-Id: I410ab590d6669d5a657f473877a2bb3cae36d0d3
-rw-r--r--core/java/android/app/Instrumentation.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 2952e6b..f99b420 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -536,9 +536,11 @@ public class Instrumentation {
*/
public final Activity waitForActivityWithTimeout(long timeOut) {
synchronized (this) {
- try {
- wait(timeOut);
- } catch (InterruptedException e) {
+ if (mLastActivity == null) {
+ try {
+ wait(timeOut);
+ } catch (InterruptedException e) {
+ }
}
if (mLastActivity == null) {
return null;