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 <tanxiaoyan@xiaomi.com>
This commit is contained in:
tanxiaoyan
2023-07-25 16:09:45 +08:00
parent e7627bd732
commit 7181301a2b

View File

@@ -1089,21 +1089,13 @@ class TaskFragment extends WindowContainer<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;
}