summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mady Mellor <madym@google.com> 2023-08-07 16:15:31 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-08-07 16:15:31 +0000
commit3a95b87db334a13d4ba2e60102acb189ae7dc7ac (patch)
tree063cce5c90b5d9bae7557b4bc61aff7d49944149
parent5a6cb1a3b6d4c5fd8937a2b46dd0b8f27d5622c2 (diff)
parent3874383ec7ef18de937026cf598ecaa0e6a2c290 (diff)
Merge "Use ShellExecutor when interacting with TaskViewTransitions" into udc-qpr-dev
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java29
1 files changed, 18 insertions, 11 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java
index a743e99d6954..adae21b20b3c 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/taskview/TaskViewTaskController.java
@@ -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);
+ });
}
/**