diff options
| author | Pierre Barbier de Reuille <pbdr@google.com> | 2021-10-28 14:51:39 +0000 |
|---|---|---|
| committer | Pierre Barbier de Reuille <pbdr@google.com> | 2021-10-28 14:51:39 +0000 |
| commit | 206066b6cc83f45a5b2c1dfa10f89ab68f43a6bc (patch) | |
| tree | e5a791508c661dfe022296068d387da22d06b93a /core/java/android/appwidget/AppWidgetHostView.java | |
| parent | a9efae988effe5d657a81a7f9a88976953e06038 (diff) | |
Check if a view can be recycled in async case.
When implementing the code, it seems this was forgotten :( If the view
id of the root of the RemoteViews is changed, currently, the top-level
view will be re-used, which is an error.
Bug: 181985606
Test: atest android.widget.cts.RemoteViewsRecyclingTest
Change-Id: I5a8addb08f597ec574e3ed49d1318771e4c7c767
Diffstat (limited to 'core/java/android/appwidget/AppWidgetHostView.java')
| -rw-r--r-- | core/java/android/appwidget/AppWidgetHostView.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java index eb10f097f37f..7c2b1b72fbf1 100644 --- a/core/java/android/appwidget/AppWidgetHostView.java +++ b/core/java/android/appwidget/AppWidgetHostView.java @@ -626,7 +626,7 @@ public class AppWidgetHostView extends FrameLayout { // If our stale view has been prepared to match active, and the new // layout matches, try recycling it - if (layoutId == mLayoutId && mView != null) { + if (remoteViews.canRecycleView(mView)) { try { mLastExecutionSignal = remoteViews.reapplyAsync(mContext, mView, |
