Fixing issue where shortcuts and widgets were not being removed when the package was uninstalled (Bug 2657997, Bug 6335843)

- Also fixes issue if we are dragging a shortcut/widget and it is removed.
- Also exposes App Info for shortcuts and widgets

Change-Id: I3bd5056f50f20e8b277dde6456df26eac815bcde
diff --git a/src/com/android/launcher2/DeleteDropTarget.java b/src/com/android/launcher2/DeleteDropTarget.java
index d8ea6ef..eb831f6 100644
--- a/src/com/android/launcher2/DeleteDropTarget.java
+++ b/src/com/android/launcher2/DeleteDropTarget.java
@@ -91,7 +91,17 @@
         return (source instanceof AppsCustomizePagedView) && (info instanceof ApplicationInfo);
     }
     private boolean isAllAppsWidget(DragSource source, Object info) {
-        return (source instanceof AppsCustomizePagedView) && (info instanceof PendingAddWidgetInfo);
+        if (source instanceof AppsCustomizePagedView) {
+            if (info instanceof PendingAddItemInfo) {
+                PendingAddItemInfo addInfo = (PendingAddItemInfo) info;
+                switch (addInfo.itemType) {
+                    case LauncherSettings.Favorites.ITEM_TYPE_SHORTCUT:
+                    case LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET:
+                        return true;
+                }
+            }
+        }
+        return false;
     }
     private boolean isDragSourceWorkspaceOrFolder(DragObject d) {
         return (d.dragSource instanceof Workspace) || (d.dragSource instanceof Folder);