Merge "Remove WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY" into sc-dev

This commit is contained in:
Louis Chang
2021-05-04 23:42:51 +00:00
committed by Android (Google) Code Review
6 changed files with 1 additions and 59 deletions

View File

@@ -429,7 +429,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

View File

@@ -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

View File

@@ -106,19 +106,9 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
* {@link ActivityOptions#setLaunchWindowingMode(int)} will be launched in
* {@link #WINDOWING_MODE_FULLSCREEN} if the display isn't currently in split-screen windowing
* mode
* @see #WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY
*/
// TODO: Remove once split-screen is migrated to wm-shell.
public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY = 4;
/**
* Alias for {@link #WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} that makes it clear that the usage
* points for APIs like {@link ActivityOptions#setLaunchWindowingMode(int)} that the container
* will launch into fullscreen or split-screen secondary depending on if the device is currently
* in fullscreen mode or split-screen mode.
*/
// TODO: Remove once split-screen is migrated to wm-shell.
public static final int WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY =
WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
/** Can be freely resized within its parent container. */
// TODO: Remove once freeform is migrated to wm-shell.
public static final int WINDOWING_MODE_FREEFORM = 5;
@@ -133,7 +123,6 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
WINDOWING_MODE_PINNED,
WINDOWING_MODE_SPLIT_SCREEN_PRIMARY,
WINDOWING_MODE_SPLIT_SCREEN_SECONDARY,
WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY,
WINDOWING_MODE_FREEFORM,
})
public @interface WindowingMode {}

View File

@@ -15,8 +15,6 @@
*/
package com.android.systemui.statusbar;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN_OR_SPLIT_SCREEN_SECONDARY;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;

View File

@@ -23,7 +23,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.ACTIVITY_TYPE_UNDEFINED;
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.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
@@ -2933,17 +2932,6 @@ class RootWindowContainer extends WindowContainer<DisplayContent>
|| 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;
}
}
}

View File

@@ -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.
*/