diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2015-08-12 15:12:16 -0700 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2015-08-14 11:42:01 -0700 |
commit | 84b4adc3fb2301466468828ccbd742209619e597 (patch) | |
tree | bc878ec3a533160dfc9b0f67cf576a915eed0737 /src/com/android/launcher3/LauncherModel.java | |
parent | f29471c751b173b91989709b9ce9ca811bf20244 (diff) | |
download | android_packages_apps_Trebuchet-84b4adc3fb2301466468828ccbd742209619e597.tar.gz android_packages_apps_Trebuchet-84b4adc3fb2301466468828ccbd742209619e597.tar.bz2 android_packages_apps_Trebuchet-84b4adc3fb2301466468828ccbd742209619e597.zip |
Disabling auto restore of widgets.
> Always show "Setup" button for a widget which has a config activity.
Bug: 23155863
Change-Id: I60683889e76be830a76ac1245e079574aaf0ad10
Diffstat (limited to 'src/com/android/launcher3/LauncherModel.java')
-rw-r--r-- | src/com/android/launcher3/LauncherModel.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/launcher3/LauncherModel.java b/src/com/android/launcher3/LauncherModel.java index d9b0cd490..6dfb4d93e 100644 --- a/src/com/android/launcher3/LauncherModel.java +++ b/src/com/android/launcher3/LauncherModel.java @@ -2194,7 +2194,7 @@ public class LauncherModel extends BroadcastReceiver // Id would be valid only if the widget restore broadcast was received. if (isIdValid) { - status = LauncherAppWidgetInfo.RESTORE_COMPLETED; + status = LauncherAppWidgetInfo.FLAG_UI_NOT_READY; } else { status &= ~LauncherAppWidgetInfo .FLAG_PROVIDER_NOT_READY; @@ -3197,6 +3197,12 @@ public class LauncherModel extends BroadcastReceiver widgetInfo.restoreStatus &= ~LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY & ~LauncherAppWidgetInfo.FLAG_RESTORE_STARTED; + + // adding this flag ensures that launcher shows 'click to setup' + // if the widget has a config activity. In case there is no config + // activity, it will be marked as 'restored' during bind. + widgetInfo.restoreStatus |= LauncherAppWidgetInfo.FLAG_UI_NOT_READY; + widgets.add(widgetInfo); updateItemInDatabase(context, widgetInfo); } |