OSDN Git Service

Force the wallpaper to reload when dimensions change
authorMichael Wright <michaelwr@google.com>
Tue, 15 Oct 2013 19:49:44 +0000 (12:49 -0700)
committerMichael Wright <michaelwr@google.com>
Tue, 15 Oct 2013 20:03:44 +0000 (13:03 -0700)
Currently it's possible for the home application to suggest new
wallpaper dimensions and the WallpaperService to request the bitmap
between when the new dimensions have been propagated and the old
bitmap has been forgotten. This leads to the WallpaperService
drawing a Bitmap with the old dimensions into a Surface with the new
dimensions.

By forcing the WallpaperManager to forget the old Bitmap immediately
before we reload it, we can ensure that we always have a Bitmap of
the correct size.

Bug: 10853302
Change-Id: I298ac5f3f8bcde54eeb1e45d21bf2ba3cbb618c9

core/java/android/app/WallpaperManager.java
packages/SystemUI/src/com/android/systemui/ImageWallpaper.java

index c39415f..f3021df 100644 (file)
@@ -278,6 +278,7 @@ public class WallpaperManager {
             synchronized (this) {
                 mWallpaper = null;
                 mDefaultWallpaper = null;
+                mHandler.removeMessages(MSG_CLEAR_WALLPAPER);
             }
         }
 
index 6fa863d..4b0c2cb 100644 (file)
@@ -326,6 +326,7 @@ public class ImageWallpaper extends WallpaperService {
                             ((mBackground == null) ? 0 : mBackground.getHeight()) + ", " +
                             dw + ", " + dh);
                 }
+                mWallpaperManager.forgetLoadedWallpaper();
                 updateWallpaperLocked();
                 if (mBackground == null) {
                     if (DEBUG) {