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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user