OSDN Git Service

Fix change of behavior in Looper.quit().
authorJeff Brown <jeffbrown@google.com>
Thu, 18 Apr 2013 22:17:48 +0000 (15:17 -0700)
committerJeff Brown <jeffbrown@google.com>
Fri, 19 Apr 2013 02:04:39 +0000 (19:04 -0700)
commit8b60e4514702edd1eb4b6f2bfc027e04a94369c0
tree83ba3f9cbbb4a7bae7a5069622b7c31d1a135775
parenta454c5732cacffdda53ae277b1e43d87b43044b1
Fix change of behavior in Looper.quit().

It seems some applications rely on Looper.quit() terminating the
loop immediately without processing all messages.  Rather than
risk breaking them, make the safer behavior optional.

Also take care to properly drain the message queue before quitting
so that all of the Message instances are recycled.  This may
help release storage sooner in case the Looper doesn't get GC'd
promptly and its remaining queue of undelivered messages sticks
around.

Improve docs on runWithScissors.

Bug: 8596303
Change-Id: I8cbeb6f7a5f6b8e618b5109f87a03defc1486b9f
api/current.txt
core/java/android/os/Handler.java
core/java/android/os/HandlerThread.java
core/java/android/os/Looper.java
core/java/android/os/MessageQueue.java
opengl/java/android/opengl/GLSurfaceView.java