diff --git a/src/com/android/launcher3/InfoDropTarget.java b/src/com/android/launcher3/InfoDropTarget.java index 006ce5dc06..d444640e62 100644 --- a/src/com/android/launcher3/InfoDropTarget.java +++ b/src/com/android/launcher3/InfoDropTarget.java @@ -50,6 +50,8 @@ public class InfoDropTarget extends UninstallDropTarget { componentName = ((ShortcutInfo) info).intent.getComponent(); } else if (info instanceof PendingAddItemInfo) { componentName = ((PendingAddItemInfo) info).componentName; + } else if (info instanceof LauncherAppWidgetInfo) { + componentName = ((LauncherAppWidgetInfo) info).providerName; } if (componentName != null) { launcher.startApplicationDetailsActivity(componentName, info.user); @@ -70,6 +72,6 @@ public class InfoDropTarget extends UninstallDropTarget { public static boolean supportsDrop(Context context, ItemInfo info) { return info instanceof AppInfo || info instanceof ShortcutInfo - || info instanceof PendingAddItemInfo; + || info instanceof PendingAddItemInfo || info instanceof LauncherAppWidgetInfo; } } diff --git a/src/com/android/launcher3/UninstallDropTarget.java b/src/com/android/launcher3/UninstallDropTarget.java index b69c79da11..73881610b4 100644 --- a/src/com/android/launcher3/UninstallDropTarget.java +++ b/src/com/android/launcher3/UninstallDropTarget.java @@ -87,9 +87,12 @@ public class UninstallDropTarget extends ButtonDropTarget { final Runnable checkIfUninstallWasSuccess = new Runnable() { @Override public void run() { - String packageName = componentInfo.first.getPackageName(); - boolean uninstallSuccessful = !AllAppsList.packageHasActivities( - getContext(), packageName, user); + boolean uninstallSuccessful = false; + if (componentInfo != null) { + String packageName = componentInfo.first.getPackageName(); + uninstallSuccessful = !AllAppsList.packageHasActivities( + getContext(), packageName, user); + } sendUninstallResult(d.dragSource, uninstallSuccessful); } };