From 321357b6066a34cc12a0528b7b835c7664db2e08 Mon Sep 17 00:00:00 2001 From: Michael Jurka Date: Thu, 17 May 2012 12:45:30 -0700 Subject: [PATCH] Fix issue where static wallpaper was offset on boot Bug: 6447391 Change-Id: Ie89bfdfd81dbf80ad7d109717f83c4bc7b42acf1 --- .../com/android/systemui/ImageWallpaper.java | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index c60c8064a83a7..96f83c6c6317c 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -281,9 +281,16 @@ public class ImageWallpaper extends WallpaperService { return; } - if (mBackgroundWidth < 0 || mBackgroundHeight < 0) { - // If we don't yet know the size of the wallpaper bitmap, - // we need to get it now. + // If we don't yet know the size of the wallpaper bitmap, + // we need to get it now. + boolean updateWallpaper = mBackgroundWidth < 0 || mBackgroundHeight < 0 ; + + // If we somehow got to this point after we have last flushed + // the wallpaper, well we really need it to draw again. So + // seems like we need to reload it. Ouch. + updateWallpaper = updateWallpaper || mBackground == null; + + if (updateWallpaper) { updateWallpaperLocked(); } @@ -308,12 +315,6 @@ public class ImageWallpaper extends WallpaperService { mLastXTranslation = xPixels; mLastYTranslation = yPixels; - if (mBackground == null) { - // If we somehow got to this point after we have last flushed - // the wallpaper, well we really need it to draw again. So - // seems like we need to reload it. Ouch. - updateWallpaperLocked(); - } if (mIsHwAccelerated) { if (!drawWallpaperWithOpenGL(sh, availw, availh, xPixels, yPixels)) {