Merge "Do not create window decorations for split roots" into udc-dev
This commit is contained in:
@@ -337,6 +337,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
|
||||
return isTaskInSplitScreen(taskId) && isSplitScreenVisible();
|
||||
}
|
||||
|
||||
/** Check whether the task is the single-top root or the root of one of the stages. */
|
||||
public boolean isTaskRootOrStageRoot(int taskId) {
|
||||
return mStageCoordinator.isRootOrStageRoot(taskId);
|
||||
}
|
||||
|
||||
public @SplitPosition int getSplitPosition(int taskId) {
|
||||
return mStageCoordinator.getSplitPosition(taskId);
|
||||
}
|
||||
|
||||
@@ -377,6 +377,13 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
return STAGE_TYPE_UNDEFINED;
|
||||
}
|
||||
|
||||
boolean isRootOrStageRoot(int taskId) {
|
||||
if (mRootTaskInfo != null && mRootTaskInfo.taskId == taskId) {
|
||||
return true;
|
||||
}
|
||||
return mMainStage.isRootTaskId(taskId) || mSideStage.isRootTaskId(taskId);
|
||||
}
|
||||
|
||||
boolean moveToStage(ActivityManager.RunningTaskInfo task, @SplitPosition int stagePosition,
|
||||
WindowContainerTransaction wct) {
|
||||
prepareEnterSplitScreen(wct, task, stagePosition);
|
||||
|
||||
@@ -286,6 +286,10 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isRootTaskId(int taskId) {
|
||||
return mRootTaskInfo != null && mRootTaskInfo.taskId == taskId;
|
||||
}
|
||||
|
||||
void onResizing(Rect newBounds, Rect sideBounds, SurfaceControl.Transaction t, int offsetX,
|
||||
int offsetY, boolean immediately) {
|
||||
if (mSplitDecorManager != null && mRootTaskInfo != null) {
|
||||
|
||||
@@ -760,6 +760,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
|
||||
|
||||
private boolean shouldShowWindowDecor(RunningTaskInfo taskInfo) {
|
||||
if (taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) return true;
|
||||
if (mSplitScreenController.isPresent()
|
||||
&& mSplitScreenController.get().isTaskRootOrStageRoot(taskInfo.taskId)) {
|
||||
return false;
|
||||
}
|
||||
return DesktopModeStatus.isProto2Enabled()
|
||||
&& taskInfo.getActivityType() == ACTIVITY_TYPE_STANDARD
|
||||
&& mDisplayController.getDisplayContext(taskInfo.displayId)
|
||||
|
||||
Reference in New Issue
Block a user