From cfbeab15f5379a203cbab5afbf056870d262553f Mon Sep 17 00:00:00 2001 From: Pinyao Ting Date: Mon, 16 Sep 2019 13:11:45 -0700 Subject: fix the issue update handler tries to cache a shortcut without valid bitmap. Change-Id: Ie400fdb811928015903319eed69879de1728539a --- .../src/com/android/launcher3/icons/cache/BaseIconCache.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'iconloaderlib') diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java index 36d1c3ecc..c100f0596 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java +++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java @@ -267,6 +267,10 @@ public abstract class BaseIconCache { entry = new CacheEntry(); cachingLogic.loadIcon(mContext, object, entry); } + // Icon can't be loaded from cachingLogic, which implies alternative icon was loaded + // (e.g. fallback icon, default icon). So we drop here since there's no point in caching + // an empty entry. + if (entry.icon == null) return; entry.title = cachingLogic.getLabel(object); entry.contentDescription = mPackageManager.getUserBadgedLabel(entry.title, user); mCache.put(key, entry); -- cgit v1.2.3