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.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java
index bec1f9eb3..b3ac12b37 100644
--- a/src/com/android/launcher3/LauncherAppWidgetInfo.java
+++ b/src/com/android/launcher3/LauncherAppWidgetInfo.java
@@ -28,6 +28,18 @@ import com.android.launcher3.compat.UserHandleCompat;
*/
public class LauncherAppWidgetInfo extends ItemInfo {
+ public static final int RESTORE_COMPLETED = 0;
+
+ /**
+ * This is set during the package backup creation.
+ */
+ public static final int RESTORE_REMAP_PENDING = 1;
+
+ /**
+ * Widget provider is not yet installed.
+ */
+ public static final int RESTORE_PROVIDER_PENDING = 2;
+
/**
* Indicates that the widget hasn't been instantiated yet.
*/
@@ -45,6 +57,11 @@ public class LauncherAppWidgetInfo extends ItemInfo {
int minWidth = -1;
int minHeight = -1;
+ /**
+ * Indicates the restore status of the widget.
+ */
+ int restoreStatus;
+
private boolean mHasNotifiedInitialWidgetSizeChanged;
/**
@@ -64,6 +81,7 @@ public class LauncherAppWidgetInfo extends ItemInfo {
spanY = -1;
// We only support app widgets on current user.
user = UserHandleCompat.myUserHandle();
+ restoreStatus = RESTORE_COMPLETED;
}
@Override
@@ -101,4 +119,8 @@ public class LauncherAppWidgetInfo extends ItemInfo {
super.unbind();
hostView = null;
}
+
+ public final boolean isWidgetIdValid() {
+ return restoreStatus != RESTORE_REMAP_PENDING;
+ }
}