From 57882dab5fb11b1af1d7db8cba625f5bcec9596a Mon Sep 17 00:00:00 2001 From: Jigar Thakkar Date: Tue, 10 Aug 2021 16:17:26 +0000 Subject: [PATCH] Notify changes after loading icon in sharesheet The icon loading inside the sharesheet happens as a separate async task inside the bindViewHolder. We have seen it taking longer time in some cases which caused the icon loading to happen after the bindViewHolder resulting in empty icons being loaded in the sharesheet for wembley/namaste phone devices. This change introduces a call to notify observers after the icon loading is done. Test: Tested on device Bug: 194886990 Change-Id: Id1752f10ced7877efe5eff90aac6db2bd656f34c --- core/java/com/android/internal/app/ResolverListAdapter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/java/com/android/internal/app/ResolverListAdapter.java b/core/java/com/android/internal/app/ResolverListAdapter.java index c16ee42f49269..7d2cb50a9b4e4 100644 --- a/core/java/com/android/internal/app/ResolverListAdapter.java +++ b/core/java/com/android/internal/app/ResolverListAdapter.java @@ -789,6 +789,9 @@ public class ResolverListAdapter extends BaseAdapter { } else { mDisplayResolveInfo.setDisplayIcon(d); mHolder.bindIcon(mDisplayResolveInfo); + // Notify in case view is already bound to resolve the race conditions on + // low end devices + notifyDataSetChanged(); } }