summaryrefslogtreecommitdiff
path: root/core/java/android/widget/RemoteViewsAdapter.java
diff options
context:
space:
mode:
authorStevie Kideckel <kideckel@google.com>2021-04-26 09:20:32 +0000
committerPierre Barbier de Reuille <pbdr@google.com>2021-05-04 23:18:45 +0100
commit691ff96db612f7bae9092d07d67fb86e4f28d2c6 (patch)
tree67b8668c59eab9201f6a98e203daea45cafcdc86 /core/java/android/widget/RemoteViewsAdapter.java
parent2e44480716139d16fd41d91bf1201298e4b7c230 (diff)
Save/restore view states when reapplying RemoteViews for color changes
This ensures that adapters have their caches filles and other benefits such as lists maintaining their scroll positions Bug: 183503469 Test: validated with local app that service is not called on drag for colors changing and that flicker is removed Change-Id: I043d1d7a547b012f7a12eb555b35854a9bb7109b
Diffstat (limited to 'core/java/android/widget/RemoteViewsAdapter.java')
-rw-r--r--core/java/android/widget/RemoteViewsAdapter.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/android/widget/RemoteViewsAdapter.java b/core/java/android/widget/RemoteViewsAdapter.java
index 9749a688a97f..6b33428d7fe4 100644
--- a/core/java/android/widget/RemoteViewsAdapter.java
+++ b/core/java/android/widget/RemoteViewsAdapter.java
@@ -86,8 +86,8 @@ public class RemoteViewsAdapter extends BaseAdapter implements Handler.Callback
// Default height for the default loading view, in case we cannot get inflate the first view
private static final int DEFAULT_LOADING_VIEW_HEIGHT = 50;
- // We cache the FixedSizeRemoteViewsCaches across orientation. These are the related data
- // structures;
+ // We cache the FixedSizeRemoteViewsCaches across orientation and re-inflation due to color
+ // palette changes. These are the related data structures:
private static final HashMap<RemoteViewsCacheKey, FixedSizeRemoteViewsCache>
sCachedRemoteViewsCaches = new HashMap<>();
private static final HashMap<RemoteViewsCacheKey, Runnable>