summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/icons
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2019-01-25 15:10:18 -0800
committerSunny Goyal <sunnygoyal@google.com>2019-01-29 11:29:52 -0800
commit8c48d8bea64b95916b18bd41a4fdb58d4d7477be (patch)
tree1a3538863bdb43b87eef0b1238d17ac908f045c5 /src/com/android/launcher3/icons
parent9752705e92593adfb60568ac4d059cc776cfceaa (diff)
downloadpackages_apps_Trebuchet-8c48d8bea64b95916b18bd41a4fdb58d4d7477be.tar.gz
packages_apps_Trebuchet-8c48d8bea64b95916b18bd41a4fdb58d4d7477be.tar.bz2
packages_apps_Trebuchet-8c48d8bea64b95916b18bd41a4fdb58d4d7477be.zip
Changing min sdk to 25
Change-Id: I0d28069967854357ca755bf25dec19d4979bdecf
Diffstat (limited to 'src/com/android/launcher3/icons')
-rw-r--r--src/com/android/launcher3/icons/IconCache.java11
-rw-r--r--src/com/android/launcher3/icons/LauncherIcons.java5
2 files changed, 9 insertions, 7 deletions
diff --git a/src/com/android/launcher3/icons/IconCache.java b/src/com/android/launcher3/icons/IconCache.java
index 4b54bc3ea..fb0a36749 100644
--- a/src/com/android/launcher3/icons/IconCache.java
+++ b/src/com/android/launcher3/icons/IconCache.java
@@ -47,7 +47,8 @@ import com.android.launcher3.icons.cache.HandlerRunnable;
import com.android.launcher3.model.PackageItemInfo;
import com.android.launcher3.util.InstantAppResolver;
import com.android.launcher3.util.Preconditions;
-import com.android.launcher3.util.Provider;
+
+import java.util.function.Supplier;
import androidx.annotation.NonNull;
@@ -156,7 +157,7 @@ public class IconCache extends BaseIconCache {
*/
public synchronized void updateTitleAndIcon(AppInfo application) {
CacheEntry entry = cacheLocked(application.componentName,
- application.user, Provider.of(null), mLauncherActivityInfoCachingLogic,
+ application.user, () -> null, mLauncherActivityInfoCachingLogic,
false, application.usingLowResIcon());
if (entry.icon != null && !isDefaultIcon(entry.icon, application.user)) {
applyCacheEntry(entry, application);
@@ -169,7 +170,7 @@ public class IconCache extends BaseIconCache {
public synchronized void getTitleAndIcon(ItemInfoWithIcon info,
LauncherActivityInfo activityInfo, boolean useLowResIcon) {
// If we already have activity info, no need to use package icon
- getTitleAndIcon(info, Provider.of(activityInfo), false, useLowResIcon);
+ getTitleAndIcon(info, () -> activityInfo, false, useLowResIcon);
}
/**
@@ -191,7 +192,7 @@ public class IconCache extends BaseIconCache {
}
public synchronized String getTitleNoCache(ComponentWithLabel info) {
- CacheEntry entry = cacheLocked(info.getComponent(), info.getUser(), Provider.of(info),
+ CacheEntry entry = cacheLocked(info.getComponent(), info.getUser(), () -> info,
mComponentWithLabelCachingLogic, false /* usePackageIcon */,
true /* useLowResIcon */, false /* addToMemCache */);
return Utilities.trim(entry.title);
@@ -202,7 +203,7 @@ public class IconCache extends BaseIconCache {
*/
private synchronized void getTitleAndIcon(
@NonNull ItemInfoWithIcon infoInOut,
- @NonNull Provider<LauncherActivityInfo> activityInfoProvider,
+ @NonNull Supplier<LauncherActivityInfo> activityInfoProvider,
boolean usePkgIcon, boolean useLowResIcon) {
CacheEntry entry = cacheLocked(infoInOut.getTargetComponent(), infoInOut.user,
activityInfoProvider, mLauncherActivityInfoCachingLogic, usePkgIcon, useLowResIcon);
diff --git a/src/com/android/launcher3/icons/LauncherIcons.java b/src/com/android/launcher3/icons/LauncherIcons.java
index f0a63ba99..75f76d93c 100644
--- a/src/com/android/launcher3/icons/LauncherIcons.java
+++ b/src/com/android/launcher3/icons/LauncherIcons.java
@@ -31,9 +31,10 @@ import com.android.launcher3.LauncherAppState;
import com.android.launcher3.model.PackageItemInfo;
import com.android.launcher3.shortcuts.DeepShortcutManager;
import com.android.launcher3.shortcuts.ShortcutInfoCompat;
-import com.android.launcher3.util.Provider;
import com.android.launcher3.util.Themes;
+import java.util.function.Supplier;
+
import androidx.annotation.Nullable;
/**
@@ -114,7 +115,7 @@ public class LauncherIcons extends BaseIconFactory implements AutoCloseable {
}
public BitmapInfo createShortcutIcon(ShortcutInfoCompat shortcutInfo,
- boolean badged, @Nullable Provider<ItemInfoWithIcon> fallbackIconProvider) {
+ boolean badged, @Nullable Supplier<ItemInfoWithIcon> fallbackIconProvider) {
Drawable unbadgedDrawable = DeepShortcutManager.getInstance(mContext)
.getShortcutIconDrawable(shortcutInfo, mFillResIconDpi);
IconCache cache = LauncherAppState.getInstance(mContext).getIconCache();