From 33f923ec77c4cb2bc12667416503af04563c75bb Mon Sep 17 00:00:00 2001 From: Andrey Epin Date: Tue, 12 Jul 2022 10:50:20 -0700 Subject: [PATCH] Update icon only once We have multiple LoadIconTasks started for the same icon, first from the list view measurement and then from the actual view biding. We let all those tasks to update the UI which riggered (through an observed but not precicly comprehended mechanism) multiple announcements for the first item in the list. Ideally, we should have only one loading task for an item, but that would be a more complex fix. Instead, we just let the winning task to update the UI. Fix: 238681660 Test: Manual test. Change-Id: I8cc7a9a12a3b2e9e49834500d8b7d2bf3e6367d3 --- core/java/com/android/internal/app/ResolverListAdapter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/com/android/internal/app/ResolverListAdapter.java b/core/java/com/android/internal/app/ResolverListAdapter.java index 737d5e348249b..06787f193fe58 100644 --- a/core/java/com/android/internal/app/ResolverListAdapter.java +++ b/core/java/com/android/internal/app/ResolverListAdapter.java @@ -950,7 +950,7 @@ public class ResolverListAdapter extends BaseAdapter { protected void onPostExecute(Drawable d) { if (getOtherProfile() == mDisplayResolveInfo) { mResolverListCommunicator.updateProfileViewButton(); - } else { + } else if (!mDisplayResolveInfo.hasDisplayIcon()) { mDisplayResolveInfo.setDisplayIcon(d); mHolder.bindIcon(mDisplayResolveInfo); // Notify in case view is already bound to resolve the race conditions on