Merge "Remove supportsSplitScreenMultiWindow" into tm-qpr-dev
This commit is contained in:
@@ -2210,7 +2210,6 @@ public class ActivityManager {
|
||||
pw.print(((baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0));
|
||||
pw.print(" activityType="); pw.print(activityTypeToString(getActivityType()));
|
||||
pw.print(" windowingMode="); pw.print(windowingModeToString(getWindowingMode()));
|
||||
pw.print(" supportsSplitScreenMultiWindow="); pw.print(supportsSplitScreenMultiWindow);
|
||||
pw.print(" supportsMultiWindow=");
|
||||
pw.println(supportsMultiWindow);
|
||||
if (taskDescription != null) {
|
||||
|
||||
@@ -142,13 +142,6 @@ public class TaskInfo {
|
||||
@Nullable
|
||||
public LocusId mTopActivityLocusId;
|
||||
|
||||
/**
|
||||
* True if the task can go in the split-screen primary stack.
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public boolean supportsSplitScreenMultiWindow;
|
||||
|
||||
/**
|
||||
* Whether this task supports multi windowing modes based on the device settings and the
|
||||
* root activity resizability and configuration.
|
||||
@@ -516,7 +509,6 @@ public class TaskInfo {
|
||||
lastActiveTime = source.readLong();
|
||||
|
||||
taskDescription = source.readTypedObject(ActivityManager.TaskDescription.CREATOR);
|
||||
supportsSplitScreenMultiWindow = source.readBoolean();
|
||||
supportsMultiWindow = source.readBoolean();
|
||||
resizeMode = source.readInt();
|
||||
configuration.readFromParcel(source);
|
||||
@@ -563,7 +555,6 @@ public class TaskInfo {
|
||||
dest.writeLong(lastActiveTime);
|
||||
|
||||
dest.writeTypedObject(taskDescription, flags);
|
||||
dest.writeBoolean(supportsSplitScreenMultiWindow);
|
||||
dest.writeBoolean(supportsMultiWindow);
|
||||
dest.writeInt(resizeMode);
|
||||
configuration.writeToParcel(dest, flags);
|
||||
@@ -601,7 +592,6 @@ public class TaskInfo {
|
||||
+ " realActivity=" + realActivity
|
||||
+ " numActivities=" + numActivities
|
||||
+ " lastActiveTime=" + lastActiveTime
|
||||
+ " supportsSplitScreenMultiWindow=" + supportsSplitScreenMultiWindow
|
||||
+ " supportsMultiWindow=" + supportsMultiWindow
|
||||
+ " resizeMode=" + resizeMode
|
||||
+ " isResizeable=" + isResizeable
|
||||
|
||||
@@ -282,7 +282,7 @@ public class PipMenuView extends FrameLayout {
|
||||
&& mSplitScreenControllerOptional.get().isTaskInSplitScreen(taskInfo.taskId);
|
||||
mFocusedTaskAllowSplitScreen = isSplitScreen
|
||||
|| (taskInfo.getWindowingMode() == WINDOWING_MODE_FULLSCREEN
|
||||
&& taskInfo.supportsSplitScreenMultiWindow
|
||||
&& taskInfo.supportsMultiWindow
|
||||
&& taskInfo.topActivityType != WindowConfiguration.ACTIVITY_TYPE_HOME);
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ public class Task {
|
||||
return new Task(taskKey,
|
||||
td != null ? td.getPrimaryColor() : 0,
|
||||
td != null ? td.getBackgroundColor() : 0,
|
||||
taskInfo.supportsSplitScreenMultiWindow, isLocked, td, taskInfo.topActivity);
|
||||
taskInfo.supportsMultiWindow, isLocked, td, taskInfo.topActivity);
|
||||
}
|
||||
|
||||
public Task(TaskKey key) {
|
||||
|
||||
@@ -2995,25 +2995,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
&& info.supportsPictureInPicture();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether this activity supports split-screen multi-window and can be put in
|
||||
* split-screen.
|
||||
*/
|
||||
@Override
|
||||
public boolean supportsSplitScreenWindowingMode() {
|
||||
return supportsSplitScreenWindowingModeInDisplayArea(getDisplayArea());
|
||||
}
|
||||
|
||||
/**
|
||||
* @return whether this activity supports split-screen multi-window and can be put in
|
||||
* split-screen if it is in the given {@link TaskDisplayArea}.
|
||||
*/
|
||||
boolean supportsSplitScreenWindowingModeInDisplayArea(@Nullable TaskDisplayArea tda) {
|
||||
return super.supportsSplitScreenWindowingMode()
|
||||
&& mAtmService.mSupportsSplitScreenMultiWindow
|
||||
&& supportsMultiWindowInDisplayArea(tda);
|
||||
}
|
||||
|
||||
boolean supportsFreeform() {
|
||||
return supportsFreeformInDisplayArea(getDisplayArea());
|
||||
}
|
||||
|
||||
@@ -478,14 +478,6 @@ public abstract class ConfigurationContainer<E extends ConfigurationContainer> {
|
||||
return WindowConfiguration.inMultiWindowMode(windowingMode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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();
|
||||
}
|
||||
|
||||
public boolean inPinnedWindowingMode() {
|
||||
return mFullConfiguration.windowConfiguration.getWindowingMode() == WINDOWING_MODE_PINNED;
|
||||
}
|
||||
|
||||
@@ -1697,23 +1697,6 @@ class Task extends TaskFragment {
|
||||
lockTaskAuthToString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsSplitScreenWindowingMode() {
|
||||
return supportsSplitScreenWindowingModeInDisplayArea(getDisplayArea());
|
||||
}
|
||||
|
||||
boolean supportsSplitScreenWindowingModeInDisplayArea(@Nullable TaskDisplayArea tda) {
|
||||
final Task topTask = getTopMostTask();
|
||||
return super.supportsSplitScreenWindowingMode()
|
||||
&& (topTask == null || topTask.supportsSplitScreenWindowingModeInner(tda));
|
||||
}
|
||||
|
||||
private boolean supportsSplitScreenWindowingModeInner(@Nullable TaskDisplayArea tda) {
|
||||
return super.supportsSplitScreenWindowingMode()
|
||||
&& mAtmService.mSupportsSplitScreenMultiWindow
|
||||
&& supportsMultiWindowInDisplayArea(tda);
|
||||
}
|
||||
|
||||
boolean supportsFreeform() {
|
||||
return supportsFreeformInDisplayArea(getDisplayArea());
|
||||
}
|
||||
@@ -3397,9 +3380,7 @@ class Task extends TaskFragment {
|
||||
info.realActivity = realActivity;
|
||||
info.lastActiveTime = lastActiveTime;
|
||||
info.taskDescription = new ActivityManager.TaskDescription(getTaskDescription());
|
||||
info.supportsSplitScreenMultiWindow = supportsSplitScreenWindowingModeInDisplayArea(tda);
|
||||
info.supportsMultiWindow = info.supportsSplitScreenMultiWindow
|
||||
|| supportsMultiWindowInDisplayArea(tda);
|
||||
info.supportsMultiWindow = supportsMultiWindowInDisplayArea(tda);
|
||||
info.configuration.setTo(getConfiguration());
|
||||
// Update to the task's current activity type and windowing mode which may differ from the
|
||||
// window configuration
|
||||
|
||||
@@ -1900,15 +1900,12 @@ final class TaskDisplayArea extends DisplayArea<WindowContainer> {
|
||||
task.remove(false /* withTransition */, "removeTaskDisplayArea");
|
||||
} else {
|
||||
// Reparent task to corresponding launch root or display area.
|
||||
final WindowContainer launchRoot =
|
||||
task.supportsSplitScreenWindowingModeInDisplayArea(toDisplayArea)
|
||||
? toDisplayArea.getLaunchRootTask(
|
||||
final WindowContainer launchRoot = toDisplayArea.getLaunchRootTask(
|
||||
task.getWindowingMode(),
|
||||
task.getActivityType(),
|
||||
null /* options */,
|
||||
null /* sourceTask */,
|
||||
0 /* launchFlags */)
|
||||
: null;
|
||||
0 /* launchFlags */);
|
||||
task.reparent(launchRoot == null ? toDisplayArea : launchRoot, POSITION_TOP);
|
||||
|
||||
// Set the windowing mode to undefined by default to let the root task inherited the
|
||||
|
||||
@@ -2167,39 +2167,6 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
true /* shouldUpdate */, false /* activityChange */);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportsSplitScreenWindowingMode() {
|
||||
final ActivityRecord activity = new ActivityBuilder(mAtm)
|
||||
.setCreateTask(true)
|
||||
.setResizeMode(ActivityInfo.RESIZE_MODE_UNRESIZEABLE)
|
||||
.setScreenOrientation(SCREEN_ORIENTATION_LANDSCAPE)
|
||||
.build();
|
||||
|
||||
// Not allow non-resizable
|
||||
mAtm.mForceResizableActivities = false;
|
||||
mAtm.mSupportsNonResizableMultiWindow = -1;
|
||||
mAtm.mDevEnableNonResizableMultiWindow = false;
|
||||
assertFalse(activity.supportsSplitScreenWindowingMode());
|
||||
|
||||
// Force resizable
|
||||
mAtm.mForceResizableActivities = true;
|
||||
mAtm.mSupportsNonResizableMultiWindow = -1;
|
||||
mAtm.mDevEnableNonResizableMultiWindow = false;
|
||||
assertTrue(activity.supportsSplitScreenWindowingMode());
|
||||
|
||||
// Use development option to allow non-resizable
|
||||
mAtm.mForceResizableActivities = false;
|
||||
mAtm.mSupportsNonResizableMultiWindow = -1;
|
||||
mAtm.mDevEnableNonResizableMultiWindow = true;
|
||||
assertTrue(activity.supportsSplitScreenWindowingMode());
|
||||
|
||||
// Always allow non-resizable
|
||||
mAtm.mForceResizableActivities = false;
|
||||
mAtm.mSupportsNonResizableMultiWindow = 1;
|
||||
mAtm.mDevEnableNonResizableMultiWindow = false;
|
||||
assertTrue(activity.supportsSplitScreenWindowingMode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportsFreeform() {
|
||||
final ActivityRecord activity = new ActivityBuilder(mAtm)
|
||||
|
||||
@@ -1204,7 +1204,6 @@ public class RecentTasksTest extends WindowTestsBase {
|
||||
RecentTaskInfo info = mRecentTasks.createRecentTaskInfo(task, true);
|
||||
|
||||
assertTrue(info.supportsMultiWindow);
|
||||
assertTrue(info.supportsSplitScreenMultiWindow);
|
||||
|
||||
// The task can be put in split screen even if it is not attached now.
|
||||
task.removeImmediately();
|
||||
@@ -1212,7 +1211,6 @@ public class RecentTasksTest extends WindowTestsBase {
|
||||
info = mRecentTasks.createRecentTaskInfo(task, true);
|
||||
|
||||
assertTrue(info.supportsMultiWindow);
|
||||
assertTrue(info.supportsSplitScreenMultiWindow);
|
||||
|
||||
// Test non-resizable.
|
||||
// The non-resizable task cannot be put in split screen because of the config.
|
||||
@@ -1222,7 +1220,6 @@ public class RecentTasksTest extends WindowTestsBase {
|
||||
info = mRecentTasks.createRecentTaskInfo(task, true);
|
||||
|
||||
assertFalse(info.supportsMultiWindow);
|
||||
assertFalse(info.supportsSplitScreenMultiWindow);
|
||||
|
||||
// Even if it is not attached, the non-resizable task can be put in split screen as long as
|
||||
// the device supports it.
|
||||
@@ -1231,8 +1228,6 @@ public class RecentTasksTest extends WindowTestsBase {
|
||||
info = mRecentTasks.createRecentTaskInfo(task, true);
|
||||
|
||||
assertTrue(info.supportsMultiWindow);
|
||||
assertTrue(info.supportsSplitScreenMultiWindow);
|
||||
|
||||
}
|
||||
|
||||
private TaskSnapshot createSnapshot(Point taskSize, Point bufferSize) {
|
||||
|
||||
Reference in New Issue
Block a user