diff options
author | Joe Onorato <joeo@android.com> | 2010-06-23 17:44:30 -0700 |
---|---|---|
committer | Joe Onorato <joeo@android.com> | 2010-06-23 17:44:30 -0700 |
commit | c27bb559805ae5cd06f7ecf575959c60c51a22aa (patch) | |
tree | 2505098a2f7cdf145310aa5d32ae04e57eba2fa9 /core/java/android/appwidget | |
parent | 4ca092c7f101cbd95833a9ed8936e9e0485585ad (diff) | |
download | frameworks_base-c27bb559805ae5cd06f7ecf575959c60c51a22aa.zip frameworks_base-c27bb559805ae5cd06f7ecf575959c60c51a22aa.tar.gz frameworks_base-c27bb559805ae5cd06f7ecf575959c60c51a22aa.tar.bz2 |
Need to give the AppWidgetHostView the new info about the provider, in case the initialLayout
changed.
Bug: 2772728
Change-Id: I9e230fbe42d01cfc953cdafb86dd0d616d96a3ea
Diffstat (limited to 'core/java/android/appwidget')
-rw-r--r-- | core/java/android/appwidget/AppWidgetHost.java | 4 | ||||
-rw-r--r-- | core/java/android/appwidget/AppWidgetHostView.java | 25 |
2 files changed, 14 insertions, 15 deletions
diff --git a/core/java/android/appwidget/AppWidgetHost.java b/core/java/android/appwidget/AppWidgetHost.java index 88adabd..b2fc13f 100644 --- a/core/java/android/appwidget/AppWidgetHost.java +++ b/core/java/android/appwidget/AppWidgetHost.java @@ -237,7 +237,7 @@ public class AppWidgetHost { v = mViews.get(appWidgetId); } if (v != null) { - v.updateAppWidget(null, AppWidgetHostView.UPDATE_FLAGS_RESET); + v.resetAppWidget(appWidget); } } @@ -247,7 +247,7 @@ public class AppWidgetHost { v = mViews.get(appWidgetId); } if (v != null) { - v.updateAppWidget(views, 0); + v.updateAppWidget(views); } } } diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index 5375193..b33b097 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -46,8 +46,6 @@ public class AppWidgetHostView extends FrameLayout { static final boolean LOGD = false; static final boolean CROSSFADE = false; - static final int UPDATE_FLAGS_RESET = 0x00000001; - static final int VIEW_MODE_NOINIT = 0; static final int VIEW_MODE_CONTENT = 1; static final int VIEW_MODE_ERROR = 2; @@ -102,7 +100,7 @@ public class AppWidgetHostView extends FrameLayout { mAppWidgetId = appWidgetId; mInfo = info; } - + public int getAppWidgetId() { return mAppWidgetId; } @@ -148,21 +146,22 @@ public class AppWidgetHostView extends FrameLayout { } /** + * Update the AppWidgetProviderInfo for this view, and reset it to the + * initial layout. + */ + void resetAppWidget(AppWidgetProviderInfo info) { + mInfo = info; + mViewMode = VIEW_MODE_NOINIT; + updateAppWidget(null); + } + + /** * Process a set of {@link RemoteViews} coming in as an update from the * AppWidget provider. Will animate into these new views as needed */ public void updateAppWidget(RemoteViews remoteViews) { - updateAppWidget(remoteViews, 0); - } + if (LOGD) Log.d(TAG, "updateAppWidget called mOld=" + mOld); - void updateAppWidget(RemoteViews remoteViews, int flags) { - if (LOGD) Log.d(TAG, "updateAppWidget called mOld=" + mOld + " flags=0x" - + Integer.toHexString(flags)); - - if ((flags & UPDATE_FLAGS_RESET) != 0) { - mViewMode = VIEW_MODE_NOINIT; - } - boolean recycled = false; View content = null; Exception exception = null; |