Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 430d02e4 authored by Jerry Chang's avatar Jerry Chang Committed by Automerger Merge Worker
Browse files

Merge "Only reparent controlling tasks when entering split" into sc-dev am: c0302f50

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14502545

Change-Id: I15fdfe970c72f5f72d5853dbb61657c1d48d0eb2
parents 0f22f721 c0302f50
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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