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
2019-09-17 23:34:50 -07:00
parent ca939f073c
commit ddd0ff44ba
6 changed files with 26 additions and 15 deletions
@@ -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;
}
}
}