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
This commit is contained in:
Dianne Hackborn
2009-11-11 23:13:25 -08:00
committed by Android Git Automerger
2 changed files with 23 additions and 6 deletions

View File

@@ -195,7 +195,12 @@ public class WallpaperManager {
if (mDefaultWallpaper != null) {
return mDefaultWallpaper;
}
mWallpaper = getCurrentWallpaperLocked(context);
mWallpaper = null;
try {
mWallpaper = getCurrentWallpaperLocked(context);
} catch (OutOfMemoryError e) {
Log.w(TAG, "No memory load current wallpaper", e);
}
if (mWallpaper == null && returnDefault) {
mDefaultWallpaper = getDefaultWallpaperLocked(context);
return mDefaultWallpaper;
@@ -279,7 +284,12 @@ public class WallpaperManager {
} catch (IOException e) {
}
return generateBitmap(context, bm, width, height);
try {
return generateBitmap(context, bm, width, height);
} catch (OutOfMemoryError e) {
Log.w(TAG, "Can't generate default bitmap", e);
return bm;
}
}
} catch (RemoteException e) {
}