Fix blank pink loading icons by ensuring that cache entry won't downgrade existing icon.

Bug: 326607598
Test: manually tested B&R
Flag: N/A
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d073ab0b3922eb0320a6bc2141cd4a57593a0cac)
Merged-In: I8aac643ec5ca3162cd62bf1051cc751800c626dd
Change-Id: I8aac643ec5ca3162cd62bf1051cc751800c626dd
This commit is contained in:
Charlie Anderson
2024-05-08 16:45:11 -04:00
committed by Cherrypicker Worker
parent a876ea9eda
commit 0e4ebc9ff2

View File

@@ -373,8 +373,13 @@ public class IconCache extends BaseIconCache {
infoInOut.user, activityInfoProvider, mLauncherActivityInfoCachingLogic,
usePkgIcon, useLowResIcon);
applyPackageEntry(packageEntry, infoInOut, entry);
} else {
} else if (useLowResIcon || !entry.bitmap.isNullOrLowRes()
|| infoInOut.bitmap.isNullOrLowRes()) {
// Only use cache entry if it will not downgrade the current bitmap in infoInOut
applyCacheEntry(entry, infoInOut);
} else {
Log.d(TAG, "getTitleAndIcon: Cache entry bitmap was a downgrade of existing bitmap"
+ " in ItemInfo. Skipping.");
}
}