am 0c5b5883: am 1325f557: Stop crashing on invalid wallpaper thumbnail images.

Merge commit '0c5b58833a24586d1c414ca24123c8f10c1ceca0' into eclair-mr2-plus-aosp

* commit '0c5b58833a24586d1c414ca24123c8f10c1ceca0':
  Stop crashing on invalid wallpaper thumbnail images.
This commit is contained in:
Daniel Sandler
2009-11-11 17:21:52 -08:00
committed by Android Git Automerger
@@ -171,9 +171,17 @@ public class WallpaperChooser extends Activity implements AdapterView.OnItemSele
} else {
image = (ImageView) convertView;
}
image.setImageResource(mThumbs.get(position));
image.getDrawable().setDither(true);
int thumbRes = mThumbs.get(position);
image.setImageResource(thumbRes);
Drawable thumbDrawable = image.getDrawable();
if (thumbDrawable != null) {
thumbDrawable.setDither(true);
} else {
Log.e(Launcher.LOG_TAG, String.format(
"Error decoding thumbnail resId=%d for wallpaper #%d",
thumbRes, position));
}
return image;
}
}