Merge "Clean up the legacy split screen (6/n)" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fafcf3c4e2
@@ -840,15 +840,6 @@ public class WindowConfiguration implements Parcelable, Comparable<WindowConfigu
|
||||
&& windowingMode != WINDOWING_MODE_UNDEFINED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the windowingMode represents a split window.
|
||||
* @hide
|
||||
*/
|
||||
public static boolean isSplitScreenWindowingMode(int windowingMode) {
|
||||
return windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
|
||||
|| windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the windows associated with this window configuration can receive input keys.
|
||||
* @hide
|
||||
|
||||
@@ -46,7 +46,6 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.activityTypeToString;
|
||||
import static android.app.WindowConfiguration.isSplitScreenWindowingMode;
|
||||
import static android.app.admin.DevicePolicyResources.Drawables.Source.PROFILE_SWITCH_ANIMATION;
|
||||
import static android.app.admin.DevicePolicyResources.Drawables.Style.OUTLINE;
|
||||
import static android.app.admin.DevicePolicyResources.Drawables.WORK_PROFILE_ICON;
|
||||
@@ -7515,8 +7514,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
final int parentWindowingMode =
|
||||
newParentConfiguration.windowConfiguration.getWindowingMode();
|
||||
final boolean isFixedOrientationLetterboxAllowed =
|
||||
isSplitScreenWindowingMode(parentWindowingMode)
|
||||
|| parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
|
||||
parentWindowingMode == WINDOWING_MODE_MULTI_WINDOW
|
||||
|| parentWindowingMode == WINDOWING_MODE_FULLSCREEN;
|
||||
// TODO(b/181207944): Consider removing the if condition and always run
|
||||
// resolveFixedOrientationConfiguration() since this should be applied for all cases.
|
||||
|
||||
@@ -24,8 +24,6 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
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_SPLIT_SCREEN_SECONDARY;
|
||||
import static android.app.WindowConfiguration.activityTypeToString;
|
||||
import static android.app.WindowConfiguration.windowingModeToString;
|
||||
import static android.app.WindowConfigurationProto.WINDOWING_MODE;
|
||||
@@ -475,33 +473,9 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
|
||||
return WindowConfiguration.inMultiWindowMode(windowingMode);
|
||||
}
|
||||
|
||||
/** Returns true if this container is currently in split-screen windowing mode. */
|
||||
public boolean inSplitScreenWindowingMode() {
|
||||
/*@WindowConfiguration.WindowingMode*/ int windowingMode =
|
||||
mFullConfiguration.windowConfiguration.getWindowingMode();
|
||||
|
||||
return windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
|
||||
|| windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
}
|
||||
|
||||
/** Returns true if this container is currently in split-screen secondary windowing mode. */
|
||||
public boolean inSplitScreenSecondaryWindowingMode() {
|
||||
/*@WindowConfiguration.WindowingMode*/ int windowingMode =
|
||||
mFullConfiguration.windowConfiguration.getWindowingMode();
|
||||
|
||||
return windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
}
|
||||
|
||||
public boolean inSplitScreenPrimaryWindowingMode() {
|
||||
return mFullConfiguration.windowConfiguration.getWindowingMode()
|
||||
== WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this container can be put in either
|
||||
* {@link WindowConfiguration#WINDOWING_MODE_SPLIT_SCREEN_PRIMARY} or
|
||||
* {@link WindowConfiguration##WINDOWING_MODE_SPLIT_SCREEN_SECONDARY} windowing modes based on
|
||||
* its current state.
|
||||
* Returns true if this container supports split-screen multi-window and can be put in
|
||||
* split-screen based on its current state.
|
||||
*/
|
||||
public boolean supportsSplitScreenWindowingMode() {
|
||||
return mFullConfiguration.windowConfiguration.supportSplitScreenWindowingMode();
|
||||
|
||||
@@ -26,7 +26,6 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
|
||||
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
|
||||
@@ -5579,13 +5578,12 @@ class DisplayContent extends RootDisplayArea implements WindowManagerPolicy.Disp
|
||||
}
|
||||
|
||||
static boolean alwaysCreateRootTask(int windowingMode, int activityType) {
|
||||
// Always create a root task for fullscreen, freeform, and split-screen-secondary windowing
|
||||
// Always create a root task for fullscreen, freeform, and multi windowing
|
||||
// modes so that we can manage visual ordering and return types correctly.
|
||||
return activityType == ACTIVITY_TYPE_STANDARD
|
||||
&& (windowingMode == WINDOWING_MODE_FULLSCREEN
|
||||
|| windowingMode == WINDOWING_MODE_FREEFORM
|
||||
|| windowingMode == WINDOWING_MODE_PINNED
|
||||
|| windowingMode == WINDOWING_MODE_SPLIT_SCREEN_SECONDARY
|
||||
|| windowingMode == WINDOWING_MODE_MULTI_WINDOW);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,6 @@ class DragResizeMode {
|
||||
switch (mode) {
|
||||
case DRAG_RESIZE_MODE_FREEFORM:
|
||||
return rootTask.getWindowingMode() == WINDOWING_MODE_FREEFORM;
|
||||
case DRAG_RESIZE_MODE_DOCKED_DIVIDER:
|
||||
return rootTask.inSplitScreenWindowingMode();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -449,11 +449,8 @@ class InsetsPolicy {
|
||||
boolean copyState) {
|
||||
final WindowState roundedCornerWindow = mPolicy.getRoundedCornerWindow();
|
||||
final Task task = w.getTask();
|
||||
final boolean isInSplitScreenMode = task != null && task.inMultiWindowMode()
|
||||
&& task.getRootTask() != null
|
||||
&& task.getRootTask().getAdjacentTaskFragment() != null;
|
||||
if (task != null && !task.getWindowConfiguration().tasksAreFloating()
|
||||
&& (roundedCornerWindow != null || isInSplitScreenMode)) {
|
||||
&& (roundedCornerWindow != null || task.inSplitScreen())) {
|
||||
// Instead of using display frame to calculating rounded corner, for the fake rounded
|
||||
// corners drawn by divider bar or task bar, we need to re-calculate rounded corners
|
||||
// based on task bounds and if the task bounds is intersected with task bar, we should
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.server.wm;
|
||||
|
||||
import static android.app.ActivityTaskManager.INVALID_TASK_ID;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
import static android.view.RemoteAnimationTarget.MODE_CLOSING;
|
||||
@@ -610,8 +609,7 @@ public class RecentsAnimationController implements DeathRecipient {
|
||||
final TaskAnimationAdapter adapter = mPendingAnimations.get(i);
|
||||
final Task task = adapter.mTask;
|
||||
final TaskFragment adjacentTask = task.getRootTask().getAdjacentTaskFragment();
|
||||
final boolean inSplitScreen = task.getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW
|
||||
&& adjacentTask != null;
|
||||
final boolean inSplitScreen = task.inSplitScreen();
|
||||
if (task.isActivityTypeHomeOrRecents()
|
||||
// Skip if the task is in split screen and in landscape.
|
||||
|| (inSplitScreen && isDisplayLandscape)
|
||||
|
||||
@@ -29,6 +29,7 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.PINNED_WINDOWING_MODE_ELEVATION_IN_DIP;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
|
||||
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
|
||||
import static android.app.WindowConfiguration.activityTypeToString;
|
||||
@@ -1722,6 +1723,13 @@ class Task extends TaskFragment {
|
||||
&& (topTask == null || topTask.supportsSplitScreenWindowingModeInner(tda));
|
||||
}
|
||||
|
||||
/** Returns {@code true} if this task is currently in split-screen. */
|
||||
boolean inSplitScreen() {
|
||||
return getWindowingMode() == WINDOWING_MODE_MULTI_WINDOW
|
||||
&& getRootTask() != null
|
||||
&& getRootTask().getAdjacentTaskFragment() != null;
|
||||
}
|
||||
|
||||
private boolean supportsSplitScreenWindowingModeInner(@Nullable TaskDisplayArea tda) {
|
||||
return super.supportsSplitScreenWindowingMode()
|
||||
&& mAtmService.mSupportsSplitScreenMultiWindow
|
||||
@@ -6020,9 +6028,6 @@ class Task extends TaskFragment {
|
||||
}
|
||||
|
||||
boolean shouldIgnoreInput() {
|
||||
if (inSplitScreenPrimaryWindowingMode() && !isFocusable()) {
|
||||
return true;
|
||||
}
|
||||
if (mAtmService.mHasLeanbackFeature && inPinnedWindowingMode()
|
||||
&& !isFocusedRootTaskOnDisplay()) {
|
||||
// Preventing Picture-in-Picture root task from receiving input on TVs.
|
||||
|
||||
@@ -1767,8 +1767,7 @@ class TaskFragment extends WindowContainer<WindowContainer> {
|
||||
// Resolve override windowing mode to fullscreen for home task (even on freeform
|
||||
// display), or split-screen if in split-screen mode.
|
||||
if (getActivityType() == ACTIVITY_TYPE_HOME && windowingMode == WINDOWING_MODE_UNDEFINED) {
|
||||
windowingMode = WindowConfiguration.isSplitScreenWindowingMode(parentWindowingMode)
|
||||
? parentWindowingMode : WINDOWING_MODE_FULLSCREEN;
|
||||
windowingMode = WINDOWING_MODE_FULLSCREEN;
|
||||
getResolvedOverrideConfiguration().windowConfiguration.setWindowingMode(windowingMode);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import static android.app.AppOpsManager.MODE_DEFAULT;
|
||||
import static android.app.AppOpsManager.OP_NONE;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_DREAM;
|
||||
import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
|
||||
import static android.app.WindowConfiguration.isSplitScreenWindowingMode;
|
||||
import static android.content.res.Configuration.ORIENTATION_LANDSCAPE;
|
||||
import static android.graphics.GraphicsProtos.dumpPointProto;
|
||||
import static android.hardware.display.DisplayManager.SWITCHING_TYPE_NONE;
|
||||
@@ -3624,11 +3623,13 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
final int requested = mLastRequestedExclusionHeight[side];
|
||||
final int granted = mLastGrantedExclusionHeight[side];
|
||||
|
||||
final boolean inSplitScreen = getTask() != null && getTask().inSplitScreen();
|
||||
|
||||
FrameworkStatsLog.write(FrameworkStatsLog.EXCLUSION_RECT_STATE_CHANGED,
|
||||
mAttrs.packageName, requested, requested - granted /* rejected */,
|
||||
side + 1 /* Sides are 1-indexed in atoms.proto */,
|
||||
(getConfiguration().orientation == ORIENTATION_LANDSCAPE),
|
||||
isSplitScreenWindowingMode(getWindowingMode()), (int) duration);
|
||||
inSplitScreen, (int) duration);
|
||||
}
|
||||
|
||||
private void initExclusionRestrictions() {
|
||||
@@ -4163,8 +4164,7 @@ class WindowState extends WindowContainer<WindowState> implements WindowManagerP
|
||||
if (task == null) {
|
||||
return false;
|
||||
}
|
||||
if (!inSplitScreenWindowingMode() && !inFreeformWindowingMode()
|
||||
&& !task.getRootTask().mCreatedByOrganizer) {
|
||||
if (!inFreeformWindowingMode() && !task.getRootTask().mCreatedByOrganizer) {
|
||||
return false;
|
||||
}
|
||||
// TODO(157912944): formalize drag-resizing so that exceptions aren't hardcoded like this
|
||||
|
||||
@@ -1085,7 +1085,7 @@ public class ActivityStarterTests extends WindowTestsBase {
|
||||
starter.setActivityOptions(options.toBundle())
|
||||
.setReason("testWindowingModeOptionsLaunchAdjacent")
|
||||
.setOutActivity(outActivity).execute();
|
||||
assertThat(outActivity[0].inSplitScreenWindowingMode()).isFalse();
|
||||
assertThat(outActivity[0].inMultiWindowMode()).isFalse();
|
||||
|
||||
// Move activity to split-screen-primary stack and make sure it has the focus.
|
||||
TestSplitOrganizer splitOrg = new TestSplitOrganizer(mAtm, top.getDisplayContent());
|
||||
|
||||
@@ -1914,7 +1914,7 @@ public class DisplayContentTests extends WindowTestsBase {
|
||||
final WindowState nextImeTargetApp = createWindow(null /* parent */,
|
||||
TYPE_BASE_APPLICATION, "nextImeTargetApp");
|
||||
spyOn(child1);
|
||||
doReturn(true).when(child1).inSplitScreenWindowingMode();
|
||||
doReturn(false).when(mDisplayContent).shouldImeAttachedToApp();
|
||||
mDisplayContent.setImeLayeringTarget(child1);
|
||||
|
||||
spyOn(nextImeTargetApp);
|
||||
|
||||
Reference in New Issue
Block a user