Check if ThumbnailData's bitmap is null in TaskThumbnailCache
- This makes sure TaskThumbnailCache fetch for thumbnail when its Bitamp is null Fix: 206959035 Test: See steps in b/206959035 Change-Id: I03b574b0f8cc7390a8cad618bd810f44f0dee279
This commit is contained in:
@@ -134,7 +134,8 @@ public class TaskThumbnailCache {
|
||||
Preconditions.assertUIThread();
|
||||
|
||||
boolean lowResolution = !mHighResLoadingState.isEnabled();
|
||||
if (task.thumbnail != null && (!task.thumbnail.reducedResolution || lowResolution)) {
|
||||
if (task.thumbnail != null && task.thumbnail.thumbnail != null
|
||||
&& (!task.thumbnail.reducedResolution || lowResolution)) {
|
||||
// Nothing to load, the thumbnail is already high-resolution or matches what the
|
||||
// request, so just callback
|
||||
callback.accept(task.thumbnail);
|
||||
@@ -152,7 +153,8 @@ public class TaskThumbnailCache {
|
||||
Preconditions.assertUIThread();
|
||||
|
||||
ThumbnailData cachedThumbnail = mCache.getAndInvalidateIfModified(key);
|
||||
if (cachedThumbnail != null && (!cachedThumbnail.reducedResolution || lowResolution)) {
|
||||
if (cachedThumbnail != null && cachedThumbnail.thumbnail != null
|
||||
&& (!cachedThumbnail.reducedResolution || lowResolution)) {
|
||||
// Already cached, lets use that thumbnail
|
||||
callback.accept(cachedThumbnail);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user