From 2d8b0451c9ac4cdab274c34b32a3d0d4f32f2702 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Fri, 16 Dec 2022 05:21:37 +0000 Subject: [PATCH] Finishing the visible requested activity vs. destroying it The activity in the primary taskfragment was resumed and was added to the opening apps while the activity in the secondary taskfragment finished, while the device folded. Later, a WCT removed the primary taskfragment (due to split rule) and requested the client to destroy the activity. In that case, the activity was not removed from the opening apps until the Activity#onDestroyed is called, so it could be part of the transition. Bug: 261689989 Test: wm presubmit Change-Id: I47445b19ae86f59c4baecf4b6e6da567e1d264c7 --- .../java/com/android/server/wm/WindowOrganizerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java index cd777092d4387..eba3ea471a8db 100644 --- a/services/core/java/com/android/server/wm/WindowOrganizerController.java +++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java @@ -1062,7 +1062,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub if (activity == null || activity.finishing) { break; } - if (activity.isVisible()) { + if (activity.isVisible() || activity.isVisibleRequested()) { // Prevent the transition from being executed too early if the activity is // visible. activity.finishIfPossible("finish-activity-op", false /* oomAdj */);