Use ShellExecutor when interacting with TaskViewTransitions

A couple of methods in TaskViewTaskController are coming from
TaskViewTransitions so I think those are fine as is, but a couple
of places are coming from users of TaskView, so update those spots
to run on ShellExecutor.

Test: treehugger / manually tried bubbles & home controls
Bug: 290795301
Change-Id: Idf773e700873bfaf2688fff6ae1f95b43767eb99
This commit is contained in:
Mady Mellor
2023-08-04 14:37:56 -07:00
parent 5e8a303054
commit 3874383ec7

View File

@@ -94,9 +94,11 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
mShellExecutor = organizer.getExecutor();
mSyncQueue = syncQueue;
mTaskViewTransitions = taskViewTransitions;
if (mTaskViewTransitions != null) {
mTaskViewTransitions.addTaskView(this);
}
mShellExecutor.execute(() -> {
if (mTaskViewTransitions != null) {
mTaskViewTransitions.addTaskView(this);
}
});
mGuard.open("release");
}
@@ -225,10 +227,10 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
}
private void performRelease() {
if (mTaskViewTransitions != null) {
mTaskViewTransitions.removeTaskView(this);
}
mShellExecutor.execute(() -> {
if (mTaskViewTransitions != null) {
mTaskViewTransitions.removeTaskView(this);
}
mTaskOrganizer.removeListener(this);
resetTaskInfo();
});
@@ -410,9 +412,12 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
if (mTaskToken == null) {
return;
}
// Sync Transactions can't operate simultaneously with shell transition collection.
if (isUsingShellTransitions()) {
mTaskViewTransitions.setTaskBounds(this, boundsOnScreen);
mShellExecutor.execute(() -> {
// Sync Transactions can't operate simultaneously with shell transition collection.
mTaskViewTransitions.setTaskBounds(this, boundsOnScreen);
});
return;
}
@@ -430,9 +435,11 @@ public class TaskViewTaskController implements ShellTaskOrganizer.TaskListener {
Slog.w(TAG, "Trying to remove a task that was never added? (no taskToken)");
return;
}
WindowContainerTransaction wct = new WindowContainerTransaction();
wct.removeTask(mTaskToken);
mTaskViewTransitions.closeTaskView(wct, this);
mShellExecutor.execute(() -> {
WindowContainerTransaction wct = new WindowContainerTransaction();
wct.removeTask(mTaskToken);
mTaskViewTransitions.closeTaskView(wct, this);
});
}
/**