Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cce397c authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge "Letting partial update fall through if the widget has not received a...

Merge "Letting partial update fall through if the widget has not received a full update yet. (Bug 7214731)" into jb-mr1-dev
parents 2e21bdbe 66119884
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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.
     */
+5 −2
Original line number Diff line number Diff line
@@ -943,10 +943,13 @@ class AppWidgetServiceImpl {
            ensureStateLoadedLocked();
            for (int i = 0; i < N; i++) {
                AppWidgetId id = lookupAppWidgetIdLocked(appWidgetIds[i]);
                if (id.views != null) {
                    // Only trigger a partial update for a widget if it has received a full update
                    updateAppWidgetInstanceLocked(id, views, true);
                }
            }
        }
    }

    public void notifyAppWidgetViewDataChanged(int[] appWidgetIds, int viewId) {
        if (appWidgetIds == null) {
@@ -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 {