Merge "Remove the special logic of the divider bar z-ordering" into tm-qpr-dev am: 4f8c3f0841
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18320962 Change-Id: Ibfb9f66c91467887bb91626085792d3e7652f05c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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<WindowContainer> {
|
||||
*/
|
||||
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<WindowContainer> {
|
||||
// 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<WindowContainer> {
|
||||
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<WindowContainer> {
|
||||
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<WindowContainer> {
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -172,14 +172,6 @@ class TaskFragment extends WindowContainer<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<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<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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<WindowState> {
|
||||
|
||||
@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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user