From e36360177a0a713b0c94743b3c84b555183f8526 Mon Sep 17 00:00:00 2001 From: Kazuki Takise Date: Thu, 16 Mar 2023 15:12:50 +0900 Subject: [PATCH] Use pending transition when task-org is unregistered When a task-org is unregistered, the surface controls of all the tasks organized by it are recreated, and their parent-child relationship is reestablished with the new surface controls. However, as different transactions are used for this recreate operations, reparent() could be applied in an unexpected order, and could some layers left detached in SF. This CL replaces sync transition with pending transition in TaskOrgController#removeTask() to ensure that the same transaction is used for a series of operations. Bug: 271357562 Test: WM CTS no longer causes ANR. Change-Id: I8a95d3f03ae8f5dfafbca29b7e1bd252762c351c --- .../java/com/android/server/wm/TaskOrganizerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/TaskOrganizerController.java b/services/core/java/com/android/server/wm/TaskOrganizerController.java index b13136534de36..c535ac8883995 100644 --- a/services/core/java/com/android/server/wm/TaskOrganizerController.java +++ b/services/core/java/com/android/server/wm/TaskOrganizerController.java @@ -390,7 +390,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub { boolean taskAppearedSent = t.mTaskAppearedSent; if (taskAppearedSent) { if (t.getSurfaceControl() != null) { - t.migrateToNewSurfaceControl(t.getSyncTransaction()); + t.migrateToNewSurfaceControl(t.getPendingTransaction()); } t.mTaskAppearedSent = false; }