Correctly terminate when interrupted.
When handling the InterruptedException, reset the interrupted flag.
Moreover, when the thread is about to quit, do not start another query,
as this might no longer be valid. This was causing the test to be flaky.
Change-Id: I5654147a10659639efcbfda0d7e52df489b76ecd
diff --git a/src/com/android/contacts/calllog/CallLogFragment.java b/src/com/android/contacts/calllog/CallLogFragment.java
index 360f5a6..961c134 100644
--- a/src/com/android/contacts/calllog/CallLogFragment.java
+++ b/src/com/android/contacts/calllog/CallLogFragment.java
@@ -477,10 +477,11 @@
mRequests.wait(1000);
} catch (InterruptedException ie) {
// Ignore and continue processing requests
+ Thread.currentThread().interrupt();
}
}
}
- if (ciq != null && queryContactInfo(ciq)) {
+ if (!mDone && ciq != null && queryContactInfo(ciq)) {
needNotify = true;
}
}