Thumbnail Cache - check canceled status on the right thread. am: 19797b419b am: 987ba0261f am: 4163325b9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12029198 Change-Id: Iddafa2ed08ea03c5dea814aff8cc97a9bce875e5
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user