Add config to enable snapshot preloading am: ae11790d31
Change-Id: Iddbd0ef3c2db095ddc481da0883f00e3f61e7222
This commit is contained in:
@@ -43,6 +43,7 @@ public class TaskThumbnailCache {
|
||||
private final int mCacheSize;
|
||||
private final TaskKeyLruCache<ThumbnailData> mCache;
|
||||
private final HighResLoadingState mHighResLoadingState;
|
||||
private final boolean mEnableTaskSnapshotPreloading;
|
||||
|
||||
public static class HighResLoadingState {
|
||||
private boolean mIsLowRamDevice;
|
||||
@@ -100,6 +101,7 @@ public class TaskThumbnailCache {
|
||||
|
||||
Resources res = context.getResources();
|
||||
mCacheSize = res.getInteger(R.integer.recentsThumbnailCacheSize);
|
||||
mEnableTaskSnapshotPreloading = res.getBoolean(R.bool.config_enableTaskSnapshotPreloading);
|
||||
mCache = new TaskKeyLruCache<>(mCacheSize);
|
||||
}
|
||||
|
||||
@@ -212,7 +214,7 @@ public class TaskThumbnailCache {
|
||||
* @return Whether to enable background preloading of task thumbnails.
|
||||
*/
|
||||
public boolean isPreloadingEnabled() {
|
||||
return !mHighResLoadingState.mIsLowRamDevice && mHighResLoadingState.mVisible;
|
||||
return mEnableTaskSnapshotPreloading && mHighResLoadingState.mVisible;
|
||||
}
|
||||
|
||||
public static abstract class ThumbnailLoadRequest extends HandlerRunnable {
|
||||
|
||||
@@ -117,6 +117,9 @@
|
||||
<!-- Recents -->
|
||||
<item type="id" name="overview_panel"/>
|
||||
|
||||
<!-- Whether to enable background preloading of task thumbnails. -->
|
||||
<bool name="config_enableTaskSnapshotPreloading">true</bool>
|
||||
|
||||
<!-- Configuration resources -->
|
||||
<array name="dynamic_resources"> </array>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user