diff options
| author | Dianne Hackborn <hackbod@google.com> | 2009-09-11 21:13:37 -0700 |
|---|---|---|
| committer | Dianne Hackborn <hackbod@google.com> | 2009-09-14 15:29:44 -0700 |
| commit | 19382ac1a4e4e7c23a1346d299368763f149de9c (patch) | |
| tree | 9165f1b94f1bd5e9966729b1047d03a733570867 /core/java/android/os | |
| parent | 714ec1360cde8b1cbf6e6b8572256e4100f11560 (diff) | |
| download | frameworks_base-19382ac1a4e4e7c23a1346d299368763f149de9c.zip frameworks_base-19382ac1a4e4e7c23a1346d299368763f149de9c.tar.gz frameworks_base-19382ac1a4e4e7c23a1346d299368763f149de9c.tar.bz2 | |
Some optizations to wallpaper drawing/scrolling.
First, fix some issues with the final wallpaper bitmap
we use: ensure it is always 16bpp, and make sure dithering
of its bitmap is turned off. We take of dithering
when loading, to make sure we don't use it when drawing.
Also add new APIs to return the wallpaper with the equivalent
of Launcher's old FastBitmapDrawable. As doing this, also load
the default wallpaper the same way as custom ones, taking care to
resize it as needed at load time.
Finally implement a mechanism for the window manager to wait
for the wallpaper to redraw at its new position before returning
from the application's call to change the offset. This ensures
that the wallpaper better tracks the application. Note that there
is a timeout in this wait that is relatively short, and if it
expires we will run for a while without waiting.
Change-Id: Ife449437746da85958bd447e0a6cf3d2223b398c
Diffstat (limited to 'core/java/android/os')
| -rw-r--r-- | core/java/android/os/HandlerThread.java | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/os/HandlerThread.java b/core/java/android/os/HandlerThread.java index 0ce86db..65301e4 100644 --- a/core/java/android/os/HandlerThread.java +++ b/core/java/android/os/HandlerThread.java @@ -64,7 +64,7 @@ public class HandlerThread extends Thread { /** * This method returns the Looper associated with this thread. If this thread not been started * or for any reason is isAlive() returns false, this method will return null. If this thread - * has been started, this method will blocked until the looper has been initialized. + * has been started, this method will block until the looper has been initialized. * @return The looper. */ public Looper getLooper() { @@ -85,6 +85,21 @@ public class HandlerThread extends Thread { } /** + * Ask the currently running looper to quit. If the thread has not + * been started or has finished (that is if {@link #getLooper} returns + * null), then false is returned. Otherwise the looper is asked to + * quit and true is returned. + */ + public boolean quit() { + Looper looper = getLooper(); + if (looper != null) { + looper.quit(); + return true; + } + return false; + } + + /** * Returns the identifier of this thread. See Process.myTid(). */ public int getThreadId() { |
