From 7181301a2b2a6b43edcdc3d200f85a45060b0f97 Mon Sep 17 00:00:00 2001 From: tanxiaoyan Date: Tue, 25 Jul 2023 16:09:45 +0800 Subject: [PATCH] Avoid recursion for leaf task fragment in freeform mode We should not traverse all leaf taskfragments when app create task fragment but is in freeform mode. Bug:292868273 Change-Id: I99aa05bf814009948e5ff8c58d1ebb26116c3b60 Signed-off-by: tanxiaoyan --- .../java/com/android/server/wm/TaskFragment.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index d947168872478..15bc60c38b019 100644 --- a/services/core/java/com/android/server/wm/TaskFragment.java +++ b/services/core/java/com/android/server/wm/TaskFragment.java @@ -1089,21 +1089,13 @@ class TaskFragment extends WindowContainer { } final int otherWindowingMode = other.getWindowingMode(); - if (otherWindowingMode == WINDOWING_MODE_FULLSCREEN) { - if (isTranslucent(other, starting)) { - // Can be visible behind a translucent fullscreen TaskFragment. - gotTranslucentFullscreen = true; - continue; - } - return TASK_FRAGMENT_VISIBILITY_INVISIBLE; - } else if (otherWindowingMode == WINDOWING_MODE_MULTI_WINDOW - && other.matchParentBounds()) { + if (otherWindowingMode == WINDOWING_MODE_FULLSCREEN + || (otherWindowingMode != WINDOWING_MODE_PINNED && other.matchParentBounds())) { if (isTranslucent(other, starting)) { // Can be visible behind a translucent TaskFragment. gotTranslucentFullscreen = true; continue; } - // Multi-window TaskFragment that matches parent bounds would occlude other children return TASK_FRAGMENT_VISIBILITY_INVISIBLE; }