fix the issue update handler tries to cache a shortcut without valid

bitmap.

Change-Id: Ie400fdb811928015903319eed69879de1728539a
This commit is contained in:
Pinyao Ting
2019-09-16 13:11:45 -07:00
parent d13f0c5c45
commit cfbeab15f5

View File

@@ -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);