summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherAppWidgetInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetInfo.java')
-rw-r--r--src/com/android/launcher3/LauncherAppWidgetInfo.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java
index 5c6535a24..aad18b578 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.
*/
@@ -86,7 +91,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 +109,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);