summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@android.com>2010-01-04 14:43:49 -0800
committerRomain Guy <romainguy@android.com>2010-01-04 14:43:49 -0800
commitb5de7754675a2789d71493c16ae08d83640e4be7 (patch)
treec1512a360a0f5d2b39449c049cac58cd67f048fd
parent9e97dc97b4966b625a4f017edbd11675f71fbbd2 (diff)
downloadandroid_packages_apps_Trebuchet-b5de7754675a2789d71493c16ae08d83640e4be7.tar.gz
android_packages_apps_Trebuchet-b5de7754675a2789d71493c16ae08d83640e4be7.tar.bz2
android_packages_apps_Trebuchet-b5de7754675a2789d71493c16ae08d83640e4be7.zip
Prevent crash when the app passes the wrong data type as a shortcut icon.
Bug: #2353444.
-rw-r--r--src/com/android/launcher2/Launcher.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 50be60605..6f6183e45 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -751,15 +751,15 @@ public final class Launcher extends Activity
private static ApplicationInfo infoFromShortcutIntent(Context context, Intent data) {
Intent intent = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_INTENT);
String name = data.getStringExtra(Intent.EXTRA_SHORTCUT_NAME);
- Bitmap bitmap = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_ICON);
+ Parcelable bitmap = data.getParcelableExtra(Intent.EXTRA_SHORTCUT_ICON);
Drawable icon = null;
boolean filtered = false;
boolean customIcon = false;
ShortcutIconResource iconResource = null;
- if (bitmap != null) {
- icon = new FastBitmapDrawable(Utilities.createBitmapThumbnail(bitmap, context));
+ if (bitmap != null && bitmap instanceof Bitmap) {
+ icon = new FastBitmapDrawable(Utilities.createBitmapThumbnail((Bitmap) bitmap, context));
filtered = true;
customIcon = true;
} else {