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
diff --git a/core/java/com/android/internal/app/ResolverListAdapter.java b/core/java/com/android/internal/app/ResolverListAdapter.java
index 737d5e3..06787f1 100644
--- a/core/java/com/android/internal/app/ResolverListAdapter.java
+++ b/core/java/com/android/internal/app/ResolverListAdapter.java
@@ -950,7 +950,7 @@
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