summaryrefslogtreecommitdiff
path: root/core/java/android/os/Looper.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2013-04-11 19:21:32 -0700
committerJeff Brown <jeffbrown@google.com>2013-04-11 20:40:04 -0700
commit024136f57e5f8b4c11a4fe0fd83061eb6d372d26 (patch)
tree5a44d54558df69fd7241caea051f13746f701174 /core/java/android/os/Looper.java
parenta2f289a40db821c1961e16c2f4acc5785dbb3394 (diff)
Ensure looper quits after all other messages are handled.
Bug: 8596303 Change-Id: Ie8bfbbe810f5ade2afd870c8e675ce1353a80e5d
Diffstat (limited to 'core/java/android/os/Looper.java')
-rw-r--r--core/java/android/os/Looper.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/java/android/os/Looper.java b/core/java/android/os/Looper.java
index 363a1bfd4c55..fa28765206f0 100644
--- a/core/java/android/os/Looper.java
+++ b/core/java/android/os/Looper.java
@@ -201,8 +201,16 @@ public final class Looper {
/**
* Quits the looper.
- *
- * Causes the {@link #loop} method to terminate as soon as possible.
+ * <p>
+ * Causes the {@link #loop} method to terminate as soon as all remaining messages
+ * in the message queue that are already due to be delivered have been handled.
+ * However delayed messages with due times in the future may not be handled before
+ * the loop terminates.
+ * </p><p>
+ * Any attempt to post messages to the queue after {@link #quit} has been called
+ * will fail. For example, the {@link Handler#sendMessage(Message)} method will
+ * return false when the looper is being terminated.
+ * </p>
*/
public void quit() {
mQueue.quit();