Loading iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java +52 −23 Original line number Diff line number Diff line Loading @@ -370,6 +370,36 @@ public abstract class BaseIconCache { object = infoProvider.get(); providerFetchedOnce = true; loadFallbackIcon( object, entry, cachingLogic, usePackageIcon, /* usePackageTitle= */ true, componentName, user); } if (TextUtils.isEmpty(entry.title)) { if (object == null && !providerFetchedOnce) { object = infoProvider.get(); providerFetchedOnce = true; } if (object != null) { loadFallbackTitle(object, entry, cachingLogic, user); } } } return entry; } /** * Fallback method for loading an icon bitmap. */ protected <T> void loadFallbackIcon( T object, CacheEntry entry, @NonNull CachingLogic<T> cachingLogic, boolean usePackageIcon, boolean usePackageTitle, @NonNull ComponentName componentName, @NonNull UserHandle user) { if (object != null) { entry.bitmap = cachingLogic.loadIcon(mContext, object); } else { Loading @@ -380,8 +410,11 @@ public abstract class BaseIconCache { if (DEBUG) Log.d(TAG, "using package default icon for " + componentName.toShortString()); entry.bitmap = packageEntry.bitmap; entry.title = packageEntry.title; entry.contentDescription = packageEntry.contentDescription; if (usePackageTitle) { entry.title = packageEntry.title; } } } if (entry.bitmap == null) { Loading @@ -392,20 +425,16 @@ public abstract class BaseIconCache { } } if (TextUtils.isEmpty(entry.title)) { if (object == null && !providerFetchedOnce) { object = infoProvider.get(); providerFetchedOnce = true; } if (object != null) { /** * Fallback method for loading an app title. */ protected <T> void loadFallbackTitle( T object, CacheEntry entry, @NonNull CachingLogic<T> cachingLogic, @NonNull UserHandle user) { entry.title = cachingLogic.getLabel(object); entry.contentDescription = mPackageManager.getUserBadgedLabel( cachingLogic.getDescription(object, entry.title), user); } } } return entry; } public synchronized void clear() { assertWorkerThread(); Loading Loading
iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java +52 −23 Original line number Diff line number Diff line Loading @@ -370,6 +370,36 @@ public abstract class BaseIconCache { object = infoProvider.get(); providerFetchedOnce = true; loadFallbackIcon( object, entry, cachingLogic, usePackageIcon, /* usePackageTitle= */ true, componentName, user); } if (TextUtils.isEmpty(entry.title)) { if (object == null && !providerFetchedOnce) { object = infoProvider.get(); providerFetchedOnce = true; } if (object != null) { loadFallbackTitle(object, entry, cachingLogic, user); } } } return entry; } /** * Fallback method for loading an icon bitmap. */ protected <T> void loadFallbackIcon( T object, CacheEntry entry, @NonNull CachingLogic<T> cachingLogic, boolean usePackageIcon, boolean usePackageTitle, @NonNull ComponentName componentName, @NonNull UserHandle user) { if (object != null) { entry.bitmap = cachingLogic.loadIcon(mContext, object); } else { Loading @@ -380,8 +410,11 @@ public abstract class BaseIconCache { if (DEBUG) Log.d(TAG, "using package default icon for " + componentName.toShortString()); entry.bitmap = packageEntry.bitmap; entry.title = packageEntry.title; entry.contentDescription = packageEntry.contentDescription; if (usePackageTitle) { entry.title = packageEntry.title; } } } if (entry.bitmap == null) { Loading @@ -392,20 +425,16 @@ public abstract class BaseIconCache { } } if (TextUtils.isEmpty(entry.title)) { if (object == null && !providerFetchedOnce) { object = infoProvider.get(); providerFetchedOnce = true; } if (object != null) { /** * Fallback method for loading an app title. */ protected <T> void loadFallbackTitle( T object, CacheEntry entry, @NonNull CachingLogic<T> cachingLogic, @NonNull UserHandle user) { entry.title = cachingLogic.getLabel(object); entry.contentDescription = mPackageManager.getUserBadgedLabel( cachingLogic.getDescription(object, entry.title), user); } } } return entry; } public synchronized void clear() { assertWorkerThread(); Loading