summaryrefslogtreecommitdiffstats
path: root/core/java/com
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-11-11 23:13:25 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2009-11-11 23:13:25 -0800
commitd669d48888fdefab4907f4de5b296fc366b59eaf (patch)
treef6ddfd9530706ad5901713a3f6ffd1f22a73b67a /core/java/com
parent36818b380dbb19275ba92fc8e307591ea7bffba4 (diff)
parent34d723d8fa75e8f97401311e03b3839246143018 (diff)
downloadframeworks_base-d669d48888fdefab4907f4de5b296fc366b59eaf.zip
frameworks_base-d669d48888fdefab4907f4de5b296fc366b59eaf.tar.gz
frameworks_base-d669d48888fdefab4907f4de5b296fc366b59eaf.tar.bz2
am 34d723d8: Merge change I32371166 into eclair
Merge commit '34d723d8fa75e8f97401311e03b3839246143018' into eclair-mr2 * commit '34d723d8fa75e8f97401311e03b3839246143018': Fix issue #2239203: Setting large background causes OOME and soft-reboot spiral
Diffstat (limited to 'core/java/com')
-rw-r--r--core/java/com/android/internal/service/wallpaper/ImageWallpaper.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java b/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java
index c09ecfb..251ecbc 100644
--- a/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java
+++ b/core/java/com/android/internal/service/wallpaper/ImageWallpaper.java
@@ -24,6 +24,7 @@ import android.graphics.drawable.Drawable;
import android.os.HandlerThread;
import android.os.Process;
import android.service.wallpaper.WallpaperService;
+import android.util.Log;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.content.Context;
@@ -134,8 +135,8 @@ public class ImageWallpaper extends WallpaperService {
final Drawable background = mBackground;
final int dw = frame.width();
final int dh = frame.height();
- final int bw = mBackground.getIntrinsicWidth();
- final int bh = mBackground.getIntrinsicHeight();
+ final int bw = background != null ? background.getIntrinsicWidth() : 0;
+ final int bh = background != null ? background.getIntrinsicHeight() : 0;
final int availw = dw-bw;
final int availh = dh-bh;
int xPixels = availw < 0 ? (int)(availw*mXOffset+.5f) : (availw/2);
@@ -148,7 +149,9 @@ public class ImageWallpaper extends WallpaperService {
c.drawColor(0xff000000);
c.restore();
}
- background.draw(c);
+ if (background != null) {
+ background.draw(c);
+ }
}
sh.unlockCanvasAndPost(c);
}
@@ -156,7 +159,11 @@ public class ImageWallpaper extends WallpaperService {
void updateWallpaper() {
synchronized (mLock) {
- mBackground = mWallpaperManager.getFastDrawable();
+ try {
+ mBackground = mWallpaperManager.getFastDrawable();
+ } catch (RuntimeException e) {
+ Log.w("ImageWallpaper", "Unable to load wallpaper!", e);
+ }
}
}
}