From 6d5082d3a593d34b413067a3cc30069aa2b78818 Mon Sep 17 00:00:00 2001 From: Louis Chang Date: Mon, 19 Apr 2021 18:49:50 +0800 Subject: [PATCH] Remove WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY This is no longer needed since WindowContainerTransaction#setLaunchRoot should be used instead. Bug: 185722220 Test: wm pre-submit Change-Id: I32ecbcc6cf9194ee4666e330617bda18651b9224 --- core/api/test-current.txt | 1 - core/java/android/app/ActivityOptions.java | 8 +----- .../java/android/app/WindowConfiguration.java | 11 -------- .../NotificationRemoteInputManager.java | 2 -- .../systemui/statusbar/phone/StatusBar.java | 1 - .../server/wm/RootWindowContainer.java | 12 --------- .../server/wm/RootWindowContainerTests.java | 26 ------------------- 7 files changed, 1 insertion(+), 60 deletions(-) diff --git a/core/api/test-current.txt b/core/api/test-current.txt index 62922dbf40fe0..c9122a854cf8e 100644 --- a/core/api/test-current.txt +++ b/core/api/test-current.txt @@ -423,7 +423,6 @@ package android.app { field public static final int ROTATION_UNDEFINED = -1; // 0xffffffff field public static final int WINDOWING_MODE_FREEFORM = 5; // 0x5 field public static final int WINDOWING_MODE_FULLSCREEN = 1; // 0x1 - field public static final int WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY = 4; // 0x4 field public static final int WINDOWING_MODE_MULTI_WINDOW = 6; // 0x6 field public static final int WINDOWING_MODE_PINNED = 2; // 0x2 field public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY = 3; // 0x3 diff --git a/core/java/android/app/ActivityOptions.java b/core/java/android/app/ActivityOptions.java index c21de62ed38ea..80f1e6eab9df8 100644 --- a/core/java/android/app/ActivityOptions.java +++ b/core/java/android/app/ActivityOptions.java @@ -1447,13 +1447,7 @@ public class ActivityOptions { } /** - * Sets the windowing mode the activity should launch into. If the input windowing mode is - * {@link android.app.WindowConfiguration#WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} and the device - * isn't currently in split-screen windowing mode, then the activity will be launched in - * {@link android.app.WindowConfiguration#WINDOWING_MODE_FULLSCREEN} windowing mode. For clarity - * on this you can use - * {@link android.app.WindowConfiguration#WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY} - * + * Sets the windowing mode the activity should launch into. * @hide */ @TestApi diff --git a/core/java/android/app/WindowConfiguration.java b/core/java/android/app/WindowConfiguration.java index d04ca1d9a48e7..4ff7924c4b984 100644 --- a/core/java/android/app/WindowConfiguration.java +++ b/core/java/android/app/WindowConfiguration.java @@ -106,19 +106,9 @@ public class WindowConfiguration implements Parcelable, Comparable || rootTask.mCreatedByOrganizer) { return rootTask; } - if (windowingMode == WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY - && container.getRootSplitScreenPrimaryTask() == rootTask - && candidateTask == rootTask.getTopMostTask()) { - // This is a special case when we try to launch an activity that is currently on - // top of root split-screen primary task, but is targeting split-screen - // secondary. - // In this case we don't want to move it to another root task. - // TODO(b/78788972): Remove after differentiating between preferred and required - // launch options. - return rootTask; - } } } diff --git a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java index 0bf237dc6545c..93a4ff82d4dce 100644 --- a/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java +++ b/services/tests/wmtests/src/com/android/server/wm/RootWindowContainerTests.java @@ -20,7 +20,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD; import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN; -import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY; import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED; import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY; import static android.content.pm.ActivityInfo.FLAG_ALWAYS_FOCUSABLE; @@ -485,31 +484,6 @@ public class RootWindowContainerTests extends WindowTestsBase { assertTrue(pinnedActivity.isFocusable()); } - /** - * Verify that split-screen primary root task will be chosen if activity is launched that - * targets split-screen secondary, but a matching existing instance is found on top of - * split-screen primary root task. - */ - @Test - public void testSplitScreenPrimaryChosenWhenTopActivityLaunchedToSecondary() { - // Create primary split-screen root task with a task and an activity. - final Task primaryRootTask = mRootWindowContainer.getDefaultTaskDisplayArea() - .createRootTask(WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, ACTIVITY_TYPE_STANDARD, - true /* onTop */); - final Task task = new TaskBuilder(mSupervisor).setParentTask(primaryRootTask).build(); - final ActivityRecord r = new ActivityBuilder(mAtm).setTask(task).build(); - - // Find a launch root task for the top activity in split-screen primary, while requesting - // split-screen secondary. - final ActivityOptions options = ActivityOptions.makeBasic(); - options.setLaunchWindowingMode(WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY); - final Task result = - mRootWindowContainer.getLaunchRootTask(r, options, task, true /* onTop */); - - // Assert that the primary root task is returned. - assertEquals(primaryRootTask, result); - } - /** * Verify that home root task would be moved to front when the top activity is Recents. */