diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 87f5442289bbe..2df158d1b565d 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -3393,7 +3393,7 @@ package android.window { method @NonNull public android.window.WindowContainerTransaction reparentTasks(@Nullable android.window.WindowContainerToken, @Nullable android.window.WindowContainerToken, @Nullable int[], @Nullable int[], boolean); method @NonNull public android.window.WindowContainerTransaction scheduleFinishEnterPip(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect); method @NonNull public android.window.WindowContainerTransaction setActivityWindowingMode(@NonNull android.window.WindowContainerToken, int); - method @NonNull public android.window.WindowContainerTransaction setAdjacentRoots(@NonNull android.window.WindowContainerToken, @NonNull android.window.WindowContainerToken, boolean); + method @NonNull public android.window.WindowContainerTransaction setAdjacentRoots(@NonNull android.window.WindowContainerToken, @NonNull android.window.WindowContainerToken); method @NonNull public android.window.WindowContainerTransaction setAdjacentTaskFragments(@NonNull android.os.IBinder, @Nullable android.os.IBinder, @Nullable android.window.WindowContainerTransaction.TaskFragmentAdjacentParams); method @NonNull public android.window.WindowContainerTransaction setAppBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect); method @NonNull public android.window.WindowContainerTransaction setBounds(@NonNull android.window.WindowContainerToken, @NonNull android.graphics.Rect); diff --git a/core/java/android/view/WindowManagerPolicyConstants.java b/core/java/android/view/WindowManagerPolicyConstants.java index 4d07171d3086a..43d427db2c750 100644 --- a/core/java/android/view/WindowManagerPolicyConstants.java +++ b/core/java/android/view/WindowManagerPolicyConstants.java @@ -237,10 +237,6 @@ public interface WindowManagerPolicyConstants { */ int LAYER_OFFSET_THUMBNAIL = WINDOW_LAYER_MULTIPLIER - 1; - // TODO(b/207185041): Remove this divider workaround after we full remove leagacy split and - // make app pair split only have single root then we can just attach the - // divider to the single root task in shell. - int SPLIT_DIVIDER_LAYER = TYPE_LAYER_MULTIPLIER * 3; int WATERMARK_LAYER = TYPE_LAYER_MULTIPLIER * 100; int STRICT_MODE_LAYER = TYPE_LAYER_MULTIPLIER * 101; int WINDOW_FREEZE_LAYER = TYPE_LAYER_MULTIPLIER * 200; diff --git a/core/java/android/window/WindowContainerTransaction.java b/core/java/android/window/WindowContainerTransaction.java index 7dc039d44f95e..633d87937049d 100644 --- a/core/java/android/window/WindowContainerTransaction.java +++ b/core/java/android/window/WindowContainerTransaction.java @@ -384,12 +384,10 @@ public final class WindowContainerTransaction implements Parcelable { */ @NonNull public WindowContainerTransaction setAdjacentRoots( - @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2, - boolean moveTogether) { + @NonNull WindowContainerToken root1, @NonNull WindowContainerToken root2) { mHierarchyOps.add(HierarchyOp.createForAdjacentRoots( root1.asBinder(), - root2.asBinder(), - moveTogether)); + root2.asBinder())); return this; } @@ -1106,9 +1104,6 @@ public final class WindowContainerTransaction implements Parcelable { private boolean mReparentTopOnly; - // TODO(b/207185041): Remove this once having a single-top root for split screen. - private boolean mMoveAdjacentTogether; - @Nullable private int[] mWindowingModes; @@ -1171,12 +1166,10 @@ public final class WindowContainerTransaction implements Parcelable { } /** Create a hierarchy op for setting adjacent root tasks. */ - public static HierarchyOp createForAdjacentRoots(IBinder root1, IBinder root2, - boolean moveTogether) { + public static HierarchyOp createForAdjacentRoots(IBinder root1, IBinder root2) { return new HierarchyOp.Builder(HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS) .setContainer(root1) .setReparentContainer(root2) - .setMoveAdjacentTogether(moveTogether) .build(); } @@ -1223,7 +1216,6 @@ public final class WindowContainerTransaction implements Parcelable { mInsetsProviderFrame = copy.mInsetsProviderFrame; mToTop = copy.mToTop; mReparentTopOnly = copy.mReparentTopOnly; - mMoveAdjacentTogether = copy.mMoveAdjacentTogether; mWindowingModes = copy.mWindowingModes; mActivityTypes = copy.mActivityTypes; mLaunchOptions = copy.mLaunchOptions; @@ -1245,7 +1237,6 @@ public final class WindowContainerTransaction implements Parcelable { } mToTop = in.readBoolean(); mReparentTopOnly = in.readBoolean(); - mMoveAdjacentTogether = in.readBoolean(); mWindowingModes = in.createIntArray(); mActivityTypes = in.createIntArray(); mLaunchOptions = in.readBundle(); @@ -1300,10 +1291,6 @@ public final class WindowContainerTransaction implements Parcelable { return mReparentTopOnly; } - public boolean getMoveAdjacentTogether() { - return mMoveAdjacentTogether; - } - public int[] getWindowingModes() { return mWindowingModes; } @@ -1356,8 +1343,7 @@ public final class WindowContainerTransaction implements Parcelable { return "{reorder: " + mContainer + " to " + (mToTop ? "top" : "bottom") + "}"; case HIERARCHY_OP_TYPE_SET_ADJACENT_ROOTS: return "{SetAdjacentRoot: container=" + mContainer - + " adjacentRoot=" + mReparent + " mMoveAdjacentTogether=" - + mMoveAdjacentTogether + "}"; + + " adjacentRoot=" + mReparent + "}"; case HIERARCHY_OP_TYPE_LAUNCH_TASK: return "{LaunchTask: " + mLaunchOptions + "}"; case HIERARCHY_OP_TYPE_SET_LAUNCH_ADJACENT_FLAG_ROOT: @@ -1413,7 +1399,6 @@ public final class WindowContainerTransaction implements Parcelable { } dest.writeBoolean(mToTop); dest.writeBoolean(mReparentTopOnly); - dest.writeBoolean(mMoveAdjacentTogether); dest.writeIntArray(mWindowingModes); dest.writeIntArray(mActivityTypes); dest.writeBundle(mLaunchOptions); @@ -1458,8 +1443,6 @@ public final class WindowContainerTransaction implements Parcelable { private boolean mReparentTopOnly; - private boolean mMoveAdjacentTogether; - @Nullable private int[] mWindowingModes; @@ -1515,11 +1498,6 @@ public final class WindowContainerTransaction implements Parcelable { return this; } - Builder setMoveAdjacentTogether(boolean moveAdjacentTogether) { - mMoveAdjacentTogether = moveAdjacentTogether; - return this; - } - Builder setWindowingModes(@Nullable int[] windowingModes) { mWindowingModes = windowingModes; return this; @@ -1570,7 +1548,6 @@ public final class WindowContainerTransaction implements Parcelable { hierarchyOp.mInsetsProviderFrame = mInsetsProviderFrame; hierarchyOp.mToTop = mToTop; hierarchyOp.mReparentTopOnly = mReparentTopOnly; - hierarchyOp.mMoveAdjacentTogether = mMoveAdjacentTogether; hierarchyOp.mLaunchOptions = mLaunchOptions; hierarchyOp.mActivityIntent = mActivityIntent; hierarchyOp.mPendingIntent = mPendingIntent; diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index f969caac3196e..3cf8a45310ef2 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -1025,8 +1025,7 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler, wct.reparent(mMainStage.mRootTaskInfo.token, mRootTaskInfo.token, true); wct.reparent(mSideStage.mRootTaskInfo.token, mRootTaskInfo.token, true); // Make the stages adjacent to each other so they occlude what's behind them. - wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token, - true /* moveTogether */); + wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token); wct.setLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token); mTaskOrganizer.applyTransaction(wct); } diff --git a/services/core/java/com/android/server/wm/Task.java b/services/core/java/com/android/server/wm/Task.java index 6b3981a0c1cc6..61ed6d3d8d8f3 100644 --- a/services/core/java/com/android/server/wm/Task.java +++ b/services/core/java/com/android/server/wm/Task.java @@ -4567,22 +4567,12 @@ class Task extends TaskFragment { moveToFront(reason, null); } - void moveToFront(String reason, Task task) { - if (mMoveAdjacentTogether && getAdjacentTaskFragment() != null) { - final Task adjacentTask = getAdjacentTaskFragment().asTask(); - if (adjacentTask != null) { - adjacentTask.moveToFrontInner(reason + " adjacentTaskToTop", null /* task */); - } - } - moveToFrontInner(reason, task); - } - /** * @param reason The reason for moving the root task to the front. * @param task If non-null, the task will be moved to the top of the root task. */ @VisibleForTesting - void moveToFrontInner(String reason, Task task) { + void moveToFront(String reason, Task task) { if (!isAttached()) { return; } diff --git a/services/core/java/com/android/server/wm/TaskDisplayArea.java b/services/core/java/com/android/server/wm/TaskDisplayArea.java index a9e80af04e1c4..d9835722130f1 100644 --- a/services/core/java/com/android/server/wm/TaskDisplayArea.java +++ b/services/core/java/com/android/server/wm/TaskDisplayArea.java @@ -29,7 +29,6 @@ import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; import static android.content.res.Configuration.ORIENTATION_LANDSCAPE; -import static android.view.WindowManagerPolicyConstants.SPLIT_DIVIDER_LAYER; import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ORIENTATION; import static com.android.server.wm.ActivityRecord.State.RESUMED; @@ -91,20 +90,6 @@ final class TaskDisplayArea extends DisplayArea { */ private int mColorLayerCounter = 0; - /** - * Given that the split-screen divider does not have an AppWindowToken, it - * will have to live inside of a "NonAppWindowContainer". However, in visual Z order - * it will need to be interleaved with some of our children, appearing on top of - * both docked root tasks but underneath any assistant root tasks. - * - * To solve this problem we have this anchor control, which will always exist so - * we can always assign it the correct value in our {@link #assignChildLayers}. - * Likewise since it always exists, we can always - * assign the divider a layer relative to it. This way we prevent linking lifecycle - * events between tasks and the divider window. - */ - private SurfaceControl mSplitScreenDividerAnchor; - // Cached reference to some special tasks we tend to get a lot so we don't need to loop // through the list to find them. private Task mRootHomeTask; @@ -730,12 +715,7 @@ final class TaskDisplayArea extends DisplayArea { // Place root home tasks to the bottom. layer = adjustRootTaskLayer(t, mTmpHomeChildren, layer); layer = adjustRootTaskLayer(t, mTmpNormalChildren, layer); - // TODO(b/207185041): Remove this divider workaround after we full remove leagacy split and - // make app pair split only have single root then we can just attach the - // divider to the single root task in shell. - layer = Math.max(layer, SPLIT_DIVIDER_LAYER + 1); adjustRootTaskLayer(t, mTmpAlwaysOnTopChildren, layer); - t.setLayer(mSplitScreenDividerAnchor, SPLIT_DIVIDER_LAYER); } /** @@ -763,19 +743,6 @@ final class TaskDisplayArea extends DisplayArea { continue; } - final Task childTask = child.asTask(); - final boolean inAdjacentTask = childTask != null - && child.inMultiWindowMode() - && childTask.getRootTask().getAdjacentTaskFragment() != null; - - if (inAdjacentTask) { - hasAdjacentTask = true; - } else if (hasAdjacentTask && startLayer < SPLIT_DIVIDER_LAYER) { - // Task on top of adjacent tasks should be higher than split divider layer so - // set it as start. - startLayer = SPLIT_DIVIDER_LAYER + 1; - } - child.assignLayer(t, startLayer++); } @@ -802,31 +769,6 @@ final class TaskDisplayArea extends DisplayArea { return activity != null ? activity.createRemoteAnimationTarget(record) : null; } - SurfaceControl getSplitScreenDividerAnchor() { - return mSplitScreenDividerAnchor; - } - - @Override - void onParentChanged(ConfigurationContainer newParent, ConfigurationContainer oldParent) { - if (getParent() != null) { - super.onParentChanged(newParent, oldParent, () -> { - mSplitScreenDividerAnchor = makeChildSurface(null) - .setName("splitScreenDividerAnchor") - .setCallsite("TaskDisplayArea.onParentChanged") - .build(); - - getSyncTransaction() - .show(mSplitScreenDividerAnchor); - }); - } else { - super.onParentChanged(newParent, oldParent); - mWmService.mTransactionFactory.get() - .remove(mSplitScreenDividerAnchor) - .apply(); - mSplitScreenDividerAnchor = null; - } - } - void setBackgroundColor(@ColorInt int colorInt) { setBackgroundColor(colorInt, false /* restore */); } @@ -872,12 +814,6 @@ final class TaskDisplayArea extends DisplayArea { setBackgroundColor(mBackgroundColor, true /* restore */); } - if (mSplitScreenDividerAnchor == null) { - return; - } - - // As TaskDisplayArea is getting a new surface, reparent and reorder the child surfaces. - t.reparent(mSplitScreenDividerAnchor, mSurfaceControl); reassignLayer(t); scheduleAnimation(); } diff --git a/services/core/java/com/android/server/wm/TaskFragment.java b/services/core/java/com/android/server/wm/TaskFragment.java index cb090ca77fa89..470e835ddfc57 100644 --- a/services/core/java/com/android/server/wm/TaskFragment.java +++ b/services/core/java/com/android/server/wm/TaskFragment.java @@ -172,14 +172,6 @@ class TaskFragment extends WindowContainer { @Nullable private TaskFragment mAdjacentTaskFragment; - /** - * Whether to move adjacent task fragment together when re-positioning. - * - * @see #mAdjacentTaskFragment - */ - // TODO(b/207185041): Remove this once having a single-top root for split screen. - boolean mMoveAdjacentTogether; - /** * Prevents duplicate calls to onTaskAppeared. */ @@ -332,15 +324,14 @@ class TaskFragment extends WindowContainer { return service.mWindowOrganizerController.getTaskFragment(token); } - void setAdjacentTaskFragment(@Nullable TaskFragment taskFragment, boolean moveTogether) { + void setAdjacentTaskFragment(@Nullable TaskFragment taskFragment) { if (mAdjacentTaskFragment == taskFragment) { return; } resetAdjacentTaskFragment(); if (taskFragment != null) { mAdjacentTaskFragment = taskFragment; - mMoveAdjacentTogether = moveTogether; - taskFragment.setAdjacentTaskFragment(this, moveTogether); + taskFragment.setAdjacentTaskFragment(this); } } @@ -349,11 +340,9 @@ class TaskFragment extends WindowContainer { if (mAdjacentTaskFragment != null && mAdjacentTaskFragment.mAdjacentTaskFragment == this) { mAdjacentTaskFragment.mAdjacentTaskFragment = null; mAdjacentTaskFragment.mDelayLastActivityRemoval = false; - mAdjacentTaskFragment.mMoveAdjacentTogether = false; } mAdjacentTaskFragment = null; mDelayLastActivityRemoval = false; - mMoveAdjacentTogether = false; } void setTaskFragmentOrganizer(@NonNull TaskFragmentOrganizerToken organizer, int uid, diff --git a/services/core/java/com/android/server/wm/WindowOrganizerController.java b/services/core/java/com/android/server/wm/WindowOrganizerController.java index 128b3292983e6..8652bc8b7eb9b 100644 --- a/services/core/java/com/android/server/wm/WindowOrganizerController.java +++ b/services/core/java/com/android/server/wm/WindowOrganizerController.java @@ -820,7 +820,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub sendTaskFragmentOperationFailure(organizer, errorCallbackToken, exception); break; } - tf1.setAdjacentTaskFragment(tf2, false /* moveAdjacentTogether */); + tf1.setAdjacentTaskFragment(tf2); effects |= TRANSACT_EFFECTS_LIFECYCLE; final Bundle bundle = hop.getLaunchOptions(); @@ -1209,7 +1209,7 @@ class WindowOrganizerController extends IWindowOrganizerController.Stub Slog.e(TAG, "Attempt to set adjacent TaskFragment in PIP Task"); return 0; } - root1.setAdjacentTaskFragment(root2, hop.getMoveAdjacentTogether()); + root1.setAdjacentTaskFragment(root2); return TRANSACT_EFFECTS_LIFECYCLE; } diff --git a/services/core/java/com/android/server/wm/WindowToken.java b/services/core/java/com/android/server/wm/WindowToken.java index 22810b294883b..ddbb930ee20c3 100644 --- a/services/core/java/com/android/server/wm/WindowToken.java +++ b/services/core/java/com/android/server/wm/WindowToken.java @@ -18,7 +18,6 @@ package com.android.server.wm; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; -import static android.view.WindowManager.LayoutParams.TYPE_DOCK_DIVIDER; import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR; import static com.android.internal.protolog.ProtoLogGroup.WM_DEBUG_ADD_REMOVE; @@ -364,11 +363,7 @@ class WindowToken extends WindowContainer { @Override void assignLayer(SurfaceControl.Transaction t, int layer) { - if (windowType == TYPE_DOCK_DIVIDER) { - // See {@link DisplayContent#mSplitScreenDividerAnchor} - super.assignRelativeLayer(t, - mDisplayContent.getDefaultTaskDisplayArea().getSplitScreenDividerAnchor(), 1); - } else if (mRoundedCornerOverlay) { + if (mRoundedCornerOverlay) { super.assignLayer(t, WindowManagerPolicy.COLOR_FADE_LAYER + 1); } else { super.assignLayer(t, layer); diff --git a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java index ff0f06126ac79..1176786eacc78 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ActivityStarterTests.java @@ -794,7 +794,7 @@ public class ActivityStarterTests extends WindowTestsBase { // Create adjacent tasks and put one activity under it final Task parent = new TaskBuilder(mSupervisor).build(); final Task adjacentParent = new TaskBuilder(mSupervisor).build(); - parent.setAdjacentTaskFragment(adjacentParent, true); + parent.setAdjacentTaskFragment(adjacentParent); final ActivityRecord activity = new ActivityBuilder(mAtm) .setParentTask(parent) .setCreateTask(true).build(); diff --git a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java index 00e1ed226d7ea..8656a4fecef17 100644 --- a/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/AppTransitionControllerTest.java @@ -593,7 +593,7 @@ public class AppTransitionControllerTest extends WindowTestsBase { .setCreatedByOrganizer(true); final Task splitRoot1 = builder.build(); final Task splitRoot2 = builder.build(); - splitRoot1.setAdjacentTaskFragment(splitRoot2, false /* moveTogether */); + splitRoot1.setAdjacentTaskFragment(splitRoot2); final ActivityRecord activity1 = createActivityRecordWithParentTask(splitRoot1); activity1.setVisible(false); activity1.mVisibleRequested = true; diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskDisplayAreaTests.java b/services/tests/wmtests/src/com/android/server/wm/TaskDisplayAreaTests.java index e8f1d2390c341..2a9fcb9d070ba 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TaskDisplayAreaTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/TaskDisplayAreaTests.java @@ -82,7 +82,7 @@ public class TaskDisplayAreaTests extends WindowTestsBase { mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); adjacentRootTask.mCreatedByOrganizer = true; final TaskDisplayArea taskDisplayArea = rootTask.getDisplayArea(); - adjacentRootTask.setAdjacentTaskFragment(rootTask, false /* moveTogether */); + adjacentRootTask.setAdjacentTaskFragment(rootTask); taskDisplayArea.setLaunchAdjacentFlagRootTask(adjacentRootTask); Task actualRootTask = taskDisplayArea.getLaunchRootTask( @@ -108,7 +108,7 @@ public class TaskDisplayAreaTests extends WindowTestsBase { final Task adjacentRootTask = createTask( mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); adjacentRootTask.mCreatedByOrganizer = true; - adjacentRootTask.setAdjacentTaskFragment(rootTask, false /* moveTogether */); + adjacentRootTask.setAdjacentTaskFragment(rootTask); taskDisplayArea.setLaunchRootTask(rootTask, new int[]{WINDOWING_MODE_MULTI_WINDOW}, new int[]{ACTIVITY_TYPE_STANDARD}); @@ -129,7 +129,7 @@ public class TaskDisplayAreaTests extends WindowTestsBase { mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); adjacentRootTask.mCreatedByOrganizer = true; final TaskDisplayArea taskDisplayArea = rootTask.getDisplayArea(); - adjacentRootTask.setAdjacentTaskFragment(rootTask, false /* moveTogether */); + adjacentRootTask.setAdjacentTaskFragment(rootTask); taskDisplayArea.setLaunchAdjacentFlagRootTask(adjacentRootTask); final Task actualRootTask = taskDisplayArea.getLaunchRootTask( @@ -756,7 +756,7 @@ public class TaskDisplayAreaTests extends WindowTestsBase { adjacentRootTask.mCreatedByOrganizer = true; final Task candidateTask = createTaskInRootTask(rootTask, 0 /* userId*/); final TaskDisplayArea taskDisplayArea = rootTask.getDisplayArea(); - adjacentRootTask.setAdjacentTaskFragment(rootTask, false /* moveTogether */); + adjacentRootTask.setAdjacentTaskFragment(rootTask); // Verify the launch root with candidate task Task actualRootTask = taskDisplayArea.getLaunchRootTask(WINDOWING_MODE_UNDEFINED, diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java index 5340a79f4b94e..7cdf5a8629cb8 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentOrganizerControllerTest.java @@ -32,7 +32,6 @@ import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.clearInvocations; @@ -412,7 +411,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase { // Throw exception if the transaction is trying to change a window that is not organized by // the organizer. - mTransaction.setAdjacentRoots(mFragmentWindowToken, token2, false /* moveTogether */); + mTransaction.setAdjacentRoots(mFragmentWindowToken, token2); assertApplyTransactionDisallowed(mTransaction); @@ -630,7 +629,7 @@ public class TaskFragmentOrganizerControllerTest extends WindowTestsBase { verify(mAtm.mWindowOrganizerController).sendTaskFragmentOperationFailure(eq(mIOrganizer), eq(errorToken), any(IllegalArgumentException.class)); - verify(mTaskFragment, never()).setAdjacentTaskFragment(any(), anyBoolean()); + verify(mTaskFragment, never()).setAdjacentTaskFragment(any()); } @Test diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java index 3ed484ac73910..228cb65aab384 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java +++ b/services/tests/wmtests/src/com/android/server/wm/TaskFragmentTest.java @@ -202,7 +202,7 @@ public class TaskFragmentTest extends WindowTestsBase { doReturn(true).when(primaryActivity).supportsPictureInPicture(); doReturn(false).when(secondaryActivity).supportsPictureInPicture(); - primaryTf.setAdjacentTaskFragment(secondaryTf, false /* moveAdjacentTogether */); + primaryTf.setAdjacentTaskFragment(secondaryTf); primaryActivity.setState(RESUMED, "test"); secondaryActivity.setState(RESUMED, "test"); @@ -448,7 +448,7 @@ public class TaskFragmentTest extends WindowTestsBase { .setOrganizer(mOrganizer) .setFragmentToken(new Binder()) .build(); - tf0.setAdjacentTaskFragment(tf1, false /* moveAdjacentTogether */); + tf0.setAdjacentTaskFragment(tf1); tf0.setWindowingMode(WINDOWING_MODE_MULTI_WINDOW); tf1.setWindowingMode(WINDOWING_MODE_MULTI_WINDOW); task.setBounds(0, 0, 1200, 1000); diff --git a/services/tests/wmtests/src/com/android/server/wm/TaskTests.java b/services/tests/wmtests/src/com/android/server/wm/TaskTests.java index 44b1d83580d6f..71387147150ec 100644 --- a/services/tests/wmtests/src/com/android/server/wm/TaskTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/TaskTests.java @@ -59,7 +59,6 @@ import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.ArgumentMatchers.same; import static org.mockito.Mockito.atLeast; import static org.mockito.Mockito.clearInvocations; @@ -1416,25 +1415,6 @@ public class TaskTests extends WindowTestsBase { assertNotNull(activity.getTask().getDimmer()); } - @Test - public void testMoveToFront_moveAdjacentTask() { - final Task task1 = - createTask(mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); - final Task task2 = - createTask(mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); - spyOn(task2); - - task1.setAdjacentTaskFragment(task2, false /* moveTogether */); - task1.moveToFront("" /* reason */); - verify(task2, never()).moveToFrontInner(anyString(), isNull()); - - // Reset adjacent tasks to move together. - task1.setAdjacentTaskFragment(null, false /* moveTogether */); - task1.setAdjacentTaskFragment(task2, true /* moveTogether */); - task1.moveToFront("" /* reason */); - verify(task2).moveToFrontInner(anyString(), isNull()); - } - @Test public void testResumeTask_doNotResumeTaskFragmentBehindTranslucent() { final Task task = createTask(mDisplayContent); diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java index f08b9fddd6af2..08bad70a14119 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowOrganizerTests.java @@ -690,7 +690,7 @@ public class WindowOrganizerTests extends WindowTestsBase { final RunningTaskInfo info2 = task2.getTaskInfo(); WindowContainerTransaction wct = new WindowContainerTransaction(); - wct.setAdjacentRoots(info1.token, info2.token, false /* moveTogether */); + wct.setAdjacentRoots(info1.token, info2.token); mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); assertEquals(task1.getAdjacentTaskFragment(), task2); assertEquals(task2.getAdjacentTaskFragment(), task1); @@ -700,8 +700,8 @@ public class WindowOrganizerTests extends WindowTestsBase { mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); assertEquals(dc.getDefaultTaskDisplayArea().mLaunchAdjacentFlagRootTask, task1); - task1.setAdjacentTaskFragment(null, false /* moveTogether */); - task2.setAdjacentTaskFragment(null, false /* moveTogether */); + task1.setAdjacentTaskFragment(null); + task2.setAdjacentTaskFragment(null); wct = new WindowContainerTransaction(); wct.clearLaunchAdjacentFlagRoot(info1.token); mWm.mAtmService.mWindowOrganizerController.applyTransaction(wct); diff --git a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java index e138d52b8ef61..b973fca74977e 100644 --- a/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java +++ b/services/tests/wmtests/src/com/android/server/wm/WindowTestsBase.java @@ -1550,7 +1550,7 @@ class WindowTestsBase extends SystemServiceTestsBase { mSecondary = mService.mTaskOrganizerController.createRootTask( display, WINDOWING_MODE_MULTI_WINDOW, null); - mPrimary.setAdjacentTaskFragment(mSecondary, true); + mPrimary.setAdjacentTaskFragment(mSecondary); display.getDefaultTaskDisplayArea().setLaunchAdjacentFlagRootTask(mSecondary); final Rect primaryBounds = new Rect(); diff --git a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java b/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java index 2df1d23c04979..77fca451547dc 100644 --- a/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/ZOrderingTests.java @@ -328,7 +328,6 @@ public class ZOrderingTests extends WindowTestsBase { assertWindowHigher(mImeWindow, imeSystemOverlayTarget); assertWindowHigher(mImeWindow, mChildAppWindowAbove); assertWindowHigher(mImeWindow, mAppWindow); - assertWindowHigher(mImeWindow, mDockedDividerWindow); // The IME has a higher base layer than the status bar so we may expect it to go // above the status bar once they are both in the Non-App layer, as past versions of this @@ -349,7 +348,6 @@ public class ZOrderingTests extends WindowTestsBase { assertWindowHigher(mImeWindow, mChildAppWindowAbove); assertWindowHigher(mImeWindow, mAppWindow); - assertWindowHigher(mImeWindow, mDockedDividerWindow); assertWindowHigher(mImeWindow, mStatusBarWindow); // And, IME dialogs should always have an higher layer than the IME. @@ -488,77 +486,6 @@ public class ZOrderingTests extends WindowTestsBase { } } - @Test - public void testDockedDividerPosition() { - final Task pinnedTask = - createTask(mDisplayContent, WINDOWING_MODE_PINNED, ACTIVITY_TYPE_STANDARD); - final WindowState pinnedWindow = - createAppWindow(pinnedTask, ACTIVITY_TYPE_STANDARD, "pinnedWindow"); - - final Task belowTask = - createTask(mDisplayContent, WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); - final WindowState belowTaskWindow = - createAppWindow(belowTask, ACTIVITY_TYPE_STANDARD, "belowTaskWindow"); - - final Task splitScreenTask1 = - createTask(mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); - final WindowState splitWindow1 = - createAppWindow(splitScreenTask1, ACTIVITY_TYPE_STANDARD, "splitWindow1"); - final Task splitScreenTask2 = - createTask(mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); - final WindowState splitWindow2 = - createAppWindow(splitScreenTask2, ACTIVITY_TYPE_STANDARD, "splitWindow2"); - splitScreenTask1.setAdjacentTaskFragment(splitScreenTask2, true /* moveTogether */); - splitScreenTask2.setAdjacentTaskFragment(splitScreenTask1, true /* moveTogether */); - - final Task aboveTask = - createTask(mDisplayContent, WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); - final WindowState aboveTaskWindow = - createAppWindow(aboveTask, ACTIVITY_TYPE_STANDARD, "aboveTaskWindow"); - - mDisplayContent.assignChildLayers(mTransaction); - - assertWindowHigher(splitWindow1, belowTaskWindow); - assertWindowHigher(splitWindow2, belowTaskWindow); - assertWindowHigher(mDockedDividerWindow, splitWindow1); - assertWindowHigher(mDockedDividerWindow, splitWindow2); - assertWindowHigher(aboveTaskWindow, mDockedDividerWindow); - assertWindowHigher(pinnedWindow, aboveTaskWindow); - } - - - @Test - public void testDockedDividerPosition_noAboveTask() { - final Task pinnedTask = - createTask(mDisplayContent, WINDOWING_MODE_PINNED, ACTIVITY_TYPE_STANDARD); - final WindowState pinnedWindow = - createAppWindow(pinnedTask, ACTIVITY_TYPE_STANDARD, "pinnedWindow"); - - final Task belowTask = - createTask(mDisplayContent, WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_STANDARD); - final WindowState belowTaskWindow = - createAppWindow(belowTask, ACTIVITY_TYPE_STANDARD, "belowTaskWindow"); - - final Task splitScreenTask1 = - createTask(mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); - final WindowState splitWindow1 = - createAppWindow(splitScreenTask1, ACTIVITY_TYPE_STANDARD, "splitWindow1"); - final Task splitScreenTask2 = - createTask(mDisplayContent, WINDOWING_MODE_MULTI_WINDOW, ACTIVITY_TYPE_STANDARD); - final WindowState splitWindow2 = - createAppWindow(splitScreenTask2, ACTIVITY_TYPE_STANDARD, "splitWindow2"); - splitScreenTask1.setAdjacentTaskFragment(splitScreenTask2, true /* moveTogether */); - splitScreenTask2.setAdjacentTaskFragment(splitScreenTask1, true /* moveTogether */); - - mDisplayContent.assignChildLayers(mTransaction); - - assertWindowHigher(splitWindow1, belowTaskWindow); - assertWindowHigher(splitWindow2, belowTaskWindow); - assertWindowHigher(mDockedDividerWindow, splitWindow1); - assertWindowHigher(mDockedDividerWindow, splitWindow2); - assertWindowHigher(pinnedWindow, mDockedDividerWindow); - } - @Test public void testAttachNavBarWhenEnteringRecents_expectNavBarHigherThanIme() { // create RecentsAnimationController