diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-04-01 12:04:16 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2016-05-26 17:44:29 -0700 |
commit | d478c83fd6abebe6ce3f066d392a28f8ba9be100 (patch) | |
tree | 5b99d0d5a53c9804339a43d8a40f7fff73654c07 /src/com/android/launcher3/LauncherAppWidgetInfo.java | |
parent | 3c62137adf79673abb5400da7e310df11f61c932 (diff) | |
download | android_packages_apps_Trebuchet-d478c83fd6abebe6ce3f066d392a28f8ba9be100.tar.gz android_packages_apps_Trebuchet-d478c83fd6abebe6ce3f066d392a28f8ba9be100.tar.bz2 android_packages_apps_Trebuchet-d478c83fd6abebe6ce3f066d392a28f8ba9be100.zip |
Showing a permission dialog when a restored widget is not yet bound, and launcher
does not has the permission to bind the widget
Change-Id: I51d32b9958f82671b928d559105129261fb8f268
Diffstat (limited to 'src/com/android/launcher3/LauncherAppWidgetInfo.java')
-rw-r--r-- | src/com/android/launcher3/LauncherAppWidgetInfo.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/com/android/launcher3/LauncherAppWidgetInfo.java b/src/com/android/launcher3/LauncherAppWidgetInfo.java index 42d646820..4c8fedf5e 100644 --- a/src/com/android/launcher3/LauncherAppWidgetInfo.java +++ b/src/com/android/launcher3/LauncherAppWidgetInfo.java @@ -51,6 +51,12 @@ public class LauncherAppWidgetInfo extends ItemInfo { public static final int FLAG_RESTORE_STARTED = 8; /** + * Indicates that the widget has been allocated an Id. The id is still not valid, as it has + * not been bound yet. + */ + public static final int FLAG_ID_ALLOCATED = 16; + + /** * Indicates that the widget hasn't been instantiated yet. */ static final int NO_ID = -1; @@ -127,8 +133,9 @@ public class LauncherAppWidgetInfo extends ItemInfo { return "AppWidget(id=" + Integer.toString(appWidgetId) + ")"; } - public final boolean isWidgetIdValid() { - return (restoreStatus & FLAG_ID_NOT_VALID) == 0; + public final boolean isWidgetIdAllocated() { + return (restoreStatus & FLAG_ID_NOT_VALID) == 0 || + (restoreStatus & FLAG_ID_ALLOCATED) == FLAG_ID_ALLOCATED; } public final boolean hasRestoreFlag(int flag) { |