Linking various settings that control icon cache to icon state

Also separating icon provider for recents from Launcher as it used a fixed size

Bug: 183641907
Test: Verified on device
Change-Id: I6ea3caa0066d1483bfb8a81f0e8aaa472c813afe
This commit is contained in:
Sunny Goyal committed 2021-05-05 23:05:38 -07:00
1 parent e41034034f
commit b47172bc4e
11 files changed
+146 -194

No files matched your search

@@ -81,10 +81,11 @@ public class IconCache extends BaseIconCache {
private int mPendingIconRequestCount = 0;
public IconCache(Context context, InvariantDeviceProfile idp) {
this(context, idp, LauncherFiles.APP_ICONS_DB);
this(context, idp, LauncherFiles.APP_ICONS_DB, new IconProvider(context));
}
public IconCache(Context context, InvariantDeviceProfile idp, String dbFileName) {
public IconCache(Context context, InvariantDeviceProfile idp, String dbFileName,
IconProvider iconProvider) {
super(context, dbFileName, MODEL_EXECUTOR.getLooper(),
idp.fillResIconDpi, idp.iconBitmapSize, true /* inMemoryCache */);
mComponentWithLabelCachingLogic = new ComponentCachingLogic(context, false);
@@ -93,7 +94,7 @@ public class IconCache extends BaseIconCache {
mLauncherApps = mContext.getSystemService(LauncherApps.class);
mUserManager = UserCache.INSTANCE.get(mContext);
mInstantAppResolver = InstantAppResolver.newInstance(mContext);
mIconProvider = new IconProvider(context, true /* supportsIconTheme */);
mIconProvider = iconProvider;
}
@Override
@@ -106,10 +107,6 @@ public class IconCache extends BaseIconCache {
return mInstantAppResolver.isInstantApp(info);
}
public IconProvider getIconProvider() {
return mIconProvider;
}
@Override
public BaseIconFactory getIconFactory() {
return LauncherIcons.obtain(mContext);