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/LauncherAppWidgetInfo.java b/src/com/android/launcher2/LauncherAppWidgetInfo.java
index 844abb5..e5b9473 100644
--- a/src/com/android/launcher2/LauncherAppWidgetInfo.java
+++ b/src/com/android/launcher2/LauncherAppWidgetInfo.java
@@ -48,11 +48,9 @@
*/
AppWidgetHostView hostView = null;
- /**
- * Constructor for use with AppWidgets that haven't been instantiated yet.
- */
- LauncherAppWidgetInfo(ComponentName providerName) {
+ LauncherAppWidgetInfo(int appWidgetId, ComponentName providerName) {
itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
+ this.appWidgetId = appWidgetId;
this.providerName = providerName;
// Since the widget isn't instantiated yet, we don't know these values. Set them to -1
@@ -61,11 +59,6 @@
spanY = -1;
}
- LauncherAppWidgetInfo(int appWidgetId) {
- itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET;
- this.appWidgetId = appWidgetId;
- }
-
@Override
void onAddToDatabase(ContentValues values) {
super.onAddToDatabase(values);