summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/LauncherAppWidgetInfo.java
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2015-07-23 17:08:47 -0700
committerHyunyoung Song <hyunyoungs@google.com>2015-07-23 17:08:47 -0700
commit680c92febe88260b74f101838a9734b8e10a704c (patch)
treee3294c3b2b32cd3532fa9b239326b1aaaa79fc40 /src/com/android/launcher3/LauncherAppWidgetInfo.java
parent494d2237b8d7b892902604c18098127e77372509 (diff)
parent13ef17a37e683b8ad5800e9f542b411180fbec2f (diff)
downloadandroid_packages_apps_Trebuchet-680c92febe88260b74f101838a9734b8e10a704c.tar.gz
android_packages_apps_Trebuchet-680c92febe88260b74f101838a9734b8e10a704c.tar.bz2
android_packages_apps_Trebuchet-680c92febe88260b74f101838a9734b8e10a704c.zip
resolved conflicts for merge of 13ef17a3 to cw-e-dev
b/22609402 Change-Id: I3753db1f922923a6b462fa75a5c0d826e0413f95
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);