am 3ba922aa: Merge "Fixing widget restore" into ub-launcher3-burnaby

* commit '3ba922aa62b70bc0a3307e43980c4ff189486694':
  Fixing widget restore
This commit is contained in:
Sunny Goyal authored and Android Git Automerger committed 2015-07-21 00:53:52 +00:00
commit 27defa5dd6
2 files changed
+31 -14

No files matched your search

+8 -2
View File
@@ -2158,7 +2158,11 @@ public class LauncherModel extends BroadcastReceiver
appWidgetInfo = new LauncherAppWidgetInfo(appWidgetId,
provider.provider);
int status = restoreStatus;
// The provider is available. So the widget is either
// available or not available. We do not need to track
// any future restore updates.
int status = restoreStatus &
~LauncherAppWidgetInfo.FLAG_RESTORE_STARTED;
if (!wasProviderReady) {
// If provider was not previously ready, update the
// status and UI flag.
@@ -3167,7 +3171,9 @@ public class LauncherModel extends BroadcastReceiver
if (mUser.equals(widgetInfo.user)
&& widgetInfo.hasRestoreFlag(LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY)
&& packageSet.contains(widgetInfo.providerName.getPackageName())) {
widgetInfo.restoreStatus &= ~LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY;
widgetInfo.restoreStatus &=
~LauncherAppWidgetInfo.FLAG_PROVIDER_NOT_READY &
~LauncherAppWidgetInfo.FLAG_RESTORE_STARTED;
widgets.add(widgetInfo);
updateItemInDatabase(context, widgetInfo);
}