Merge "Disabling auto restore of widgets. > Always show "Setup" button for a widget which has a config activity." into ub-launcher3-burnaby

This commit is contained in:
Sunny Goyal authored and Android (Google) Code Review committed 2015-08-14 19:23:57 +00:00
commit d21f9404da
3 files changed
+53 -35

No files matched your search

+7 -1
View File
@@ -2195,7 +2195,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);
}