Merge "Check if ThumbnailData's bitmap is null in TaskThumbnailCache" into sc-v2-dev

This commit is contained in:
TreeHugger Robot
2021-11-18 19:46:50 +00:00
committed by Android (Google) Code Review

View File

@@ -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;