am c2ad7a6e: Fix for #1855127. When Home cannot decode an icon, it should not interrupt the loading of the workspace, but fallback to the default package icon.

Merge commit 'c2ad7a6e1571f933f4bc8ceaee5c745a96aaaf68'

* commit 'c2ad7a6e1571f933f4bc8ceaee5c745a96aaaf68':
  Fix for #1855127. When Home cannot decode an icon, it should not interrupt the loading of the workspace, but fallback to the default package icon.
This commit is contained in:
Romain Guy 2009-05-14 17:48:20 -07:00 committed by The Android Open Source Project
commit 466dffb15e
1 changed files with 8 additions and 3 deletions

View File

@ -1169,9 +1169,14 @@ public class LauncherModel {
break;
case LauncherSettings.Favorites.ICON_TYPE_BITMAP:
byte[] data = c.getBlob(iconIndex);
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
info.icon = new FastBitmapDrawable(
Utilities.createBitmapThumbnail(bitmap, launcher));
try {
Bitmap bitmap = BitmapFactory.decodeByteArray(data, 0, data.length);
info.icon = new FastBitmapDrawable(
Utilities.createBitmapThumbnail(bitmap, launcher));
} catch (Exception e) {
packageManager = launcher.getPackageManager();
info.icon = packageManager.getDefaultActivityIcon();
}
info.filtered = true;
info.customIcon = true;
break;