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
This commit is contained in:
Winson Chung committed 2012-04-27 15:15:11 -07:00
1 parent 9cfcb39bff
commit 11a4937fbf
7 files changed
+35 -25

No files matched your search

@@ -91,7 +91,17 @@ public class DeleteDropTarget extends ButtonDropTarget {
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);