diff options
| author | Winson Chung <winsonc@google.com> | 2012-10-11 14:55:34 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-11 14:56:56 -0700 |
| commit | 4cce397c0dab44cf7b1b657d0e5410b5970eef55 (patch) | |
| tree | 2947c58e4e5e9b8a73cae39f77e9e15bd1d8fc6d | |
| parent | 2e21bdbe303a8abba406bdb5469944419e3a698a (diff) | |
| parent | 6611988429d1d70ec429f87bbf2b093cf1e2e31f (diff) | |
| download | frameworks_base-4cce397c0dab44cf7b1b657d0e5410b5970eef55.zip frameworks_base-4cce397c0dab44cf7b1b657d0e5410b5970eef55.tar.gz frameworks_base-4cce397c0dab44cf7b1b657d0e5410b5970eef55.tar.bz2 | |
Merge "Letting partial update fall through if the widget has not received a full update yet. (Bug 7214731)" into jb-mr1-dev
| -rw-r--r-- | core/java/android/appwidget/AppWidgetManager.java | 8 | ||||
| -rw-r--r-- | services/java/com/android/server/AppWidgetServiceImpl.java | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/core/java/android/appwidget/AppWidgetManager.java b/core/java/android/appwidget/AppWidgetManager.java index 888955c..2af65b9 100644 --- a/core/java/android/appwidget/AppWidgetManager.java +++ b/core/java/android/appwidget/AppWidgetManager.java @@ -448,6 +448,10 @@ public class AppWidgetManager { * and outside of the handler. * This method will only work when called from the uid that owns the AppWidget provider. * + * <p> + * This method will be ignored if a widget has not received a full update via + * {@link #updateAppWidget(int[], RemoteViews)}. + * * @param appWidgetIds The AppWidget instances for which to set the RemoteViews. * @param views The RemoteViews object containing the incremental update / command. */ @@ -476,6 +480,10 @@ public class AppWidgetManager { * and outside of the handler. * This method will only work when called from the uid that owns the AppWidget provider. * + * <p> + * This method will be ignored if a widget has not received a full update via + * {@link #updateAppWidget(int[], RemoteViews)}. + * * @param appWidgetId The AppWidget instance for which to set the RemoteViews. * @param views The RemoteViews object containing the incremental update / command. */ diff --git a/services/java/com/android/server/AppWidgetServiceImpl.java b/services/java/com/android/server/AppWidgetServiceImpl.java index 04cfa4f..9fea6f3 100644 --- a/services/java/com/android/server/AppWidgetServiceImpl.java +++ b/services/java/com/android/server/AppWidgetServiceImpl.java @@ -943,7 +943,10 @@ class AppWidgetServiceImpl { ensureStateLoadedLocked(); for (int i = 0; i < N; i++) { AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]); - updateAppWidgetInstanceLocked(id, views, true); + if (id.views != null) { + // Only trigger a partial update for a widget if it has received a full update + updateAppWidgetInstanceLocked(id, views, true); + } } } } @@ -996,7 +999,7 @@ class AppWidgetServiceImpl { // drop unbound appWidgetIds (shouldn't be possible under normal circumstances) if (id != null && id.provider != null && !id.provider.zombie && !id.host.zombie) { - if (!isPartialUpdate || id.views == null) { + if (!isPartialUpdate) { // For a full update we replace the RemoteViews completely. id.views = views; } else { |
