Exclude shortcuts in popup from IconCache.

We want to load from/save icons to icon cache for pinned shortcuts only
to reduce memory footprint.

Bug: 140242324
Change-Id: I25c7d59e29c6e27752b36c2c3c226849d4e177af
This commit is contained in:
Pinyao Ting committed 2019-09-20 15:24:22 +00:00
1 parent ca939f073c
commit ddd0ff44ba
6 files changed
+26 -15

No files matched your search

@@ -34,9 +34,11 @@ public interface ComponentWithLabel {
class ComponentCachingLogic implements CachingLogic<ComponentWithLabel> {
private final PackageManager mPackageManager;
private final boolean mAddToMemCache;
public ComponentCachingLogic(Context context) {
public ComponentCachingLogic(Context context, boolean addToMemCache) {
mPackageManager = context.getPackageManager();
mAddToMemCache = addToMemCache;
}
@Override
@@ -60,5 +62,10 @@ public interface ComponentWithLabel {
// Do not load icon.
target.icon = BitmapInfo.LOW_RES_ICON;
}
@Override
public boolean addToMemCache() {
return mAddToMemCache;
}
}
}