diff options
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetInfo.java')
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetInfo.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java index 5c6535a24..882f7e202 100644 --- a/src/com/android/launcher3/LauncherAppWidgetInfo.java +++ b/src/com/android/launcher3/LauncherAppWidgetInfo.java @@ -56,6 +56,11 @@ public class LauncherAppWidgetInfo extends ItemInfo { static final int NO_ID = -1; /** + * Indicates that this is a locally defined widget and hence has no system allocated id. + */ + static final int CUSTOM_WIDGET_ID = -100; + + /** * Identifier for this widget when talking with * {@link android.appwidget.AppWidgetManager} for updates. */ @@ -63,10 +68,6 @@ public class LauncherAppWidgetInfo extends ItemInfo { ComponentName providerName; - // TODO: Are these necessary here? - int minWidth = -1; - int minHeight = -1; - /** * Indicates the restore status of the widget. */ @@ -86,7 +87,12 @@ public class LauncherAppWidgetInfo extends ItemInfo { AppWidgetHostView hostView = null; LauncherAppWidgetInfo(int appWidgetId, ComponentName providerName) { - itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; + if (appWidgetId == CUSTOM_WIDGET_ID) { + itemType = LauncherSettings.Favorites.ITEM_TYPE_CUSTOM_APPWIDGET; + } else { + itemType = LauncherSettings.Favorites.ITEM_TYPE_APPWIDGET; + } + this.appWidgetId = appWidgetId; this.providerName = providerName; @@ -99,6 +105,10 @@ public class LauncherAppWidgetInfo extends ItemInfo { restoreStatus = RESTORE_COMPLETED; } + public boolean isCustomWidget() { + return appWidgetId == CUSTOM_WIDGET_ID; + } + @Override void onAddToDatabase(Context context, ContentValues values) { super.onAddToDatabase(context, values); |