Thumbnail Cache - check canceled status on the right thread. am: 19797b419b

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12029198

Change-Id: Icad59a9d583131d57cc69dbe7c72ebb0364649c9
This commit is contained in:
Zak Cohen
2020-06-29 22:22:39 +00:00
committed by Automerger Merge Worker
@@ -166,11 +166,13 @@ public class TaskThumbnailCache {
public void run() {
ThumbnailData thumbnail = ActivityManagerWrapper.getInstance().getTaskThumbnail(
key.id, lowResolution);
if (isCanceled()) {
// We don't call back to the provided callback in this case
return;
}
MAIN_EXECUTOR.execute(() -> {
if (isCanceled()) {
// We don't call back to the provided callback in this case
return;
}
mCache.put(key, thumbnail);
callback.accept(thumbnail);
onEnd();