Skip updating the leash if a task is removed prior to sync completion

- Only affects legacy transitions

Fixes: 243848364
Test: atest TaplTestsQuickstep
Change-Id: I9d646573e446833ded399676e0a13d8fa4d47733
This commit is contained in:
Winson Chung
2023-02-23 06:00:24 +00:00
parent c3a40b4925
commit 5502ffbfc2

View File

@@ -108,6 +108,10 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
}
if (!createdWindowDecor) {
mSyncQueue.runInSync(t -> {
if (!leash.isValid()) {
// Task vanished before sync completion
return;
}
// Reset several properties back to fullscreen (PiP, for example, leaves all these
// properties in a bad state).
t.setWindowCrop(leash, null);
@@ -136,6 +140,10 @@ public class FullscreenTaskListener implements ShellTaskOrganizer.TaskListener {
final Point positionInParent = state.mTaskInfo.positionInParent;
if (!oldPositionInParent.equals(state.mTaskInfo.positionInParent)) {
mSyncQueue.runInSync(t -> {
if (!state.mLeash.isValid()) {
// Task vanished before sync completion
return;
}
t.setPosition(state.mLeash, positionInParent.x, positionInParent.y);
});
}