From 80d67949a21ab3393e500f97647904f9c3bb3744 Mon Sep 17 00:00:00 2001 From: Jerry Chang Date: Wed, 12 May 2021 12:24:28 +0800 Subject: [PATCH] Only reparent controlling tasks when entering split Only move split controlling tasks to split secondary root when entering split. So that it could align with launch root rule while in split. Fix: 187892355 Test: enter split screen while having assist type task in recent, observed it won't reparent assist type task to split-secondary-root. Change-Id: I648dc74e2e44d62a0e40d50b29b08dd23b85ed26 --- .../wm/shell/legacysplitscreen/WindowManagerProxy.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/WindowManagerProxy.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/WindowManagerProxy.java index 1072845b35ddd..e42e43bbc2be3 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/WindowManagerProxy.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/WindowManagerProxy.java @@ -41,6 +41,7 @@ import android.window.WindowContainerToken; import android.window.WindowContainerTransaction; import com.android.internal.annotations.GuardedBy; +import com.android.internal.util.ArrayUtils; import com.android.wm.shell.common.SyncTransactionQueue; import com.android.wm.shell.transition.Transitions; @@ -214,8 +215,12 @@ class WindowManagerProxy { if (!rootTask.supportsMultiWindow && rootTask.topActivityType != ACTIVITY_TYPE_HOME) { continue; } - // Only move fullscreen tasks to split secondary. - if (rootTask.getWindowingMode() != WINDOWING_MODE_FULLSCREEN) { + // Only move split controlling tasks to split secondary. + final int windowingMode = rootTask.getWindowingMode(); + if (!ArrayUtils.contains(CONTROLLED_WINDOWING_MODES, windowingMode) + || !ArrayUtils.contains(CONTROLLED_ACTIVITY_TYPES, rootTask.getActivityType()) + // Excludes split screen secondary due to it's the root we're reparenting to. + || windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY) { continue; } // Since this iterates from bottom to top, update topHomeTask for every fullscreen task