Merge "Fix wrong divider bar layering" into sc-v2-dev

This commit is contained in:
Jerry Chang
2021-11-17 00:49:42 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 19 deletions

View File

@@ -172,6 +172,14 @@ public class LegacySplitScreenController implements DisplayController.OnDisplays
};
mWindowManager = new DividerWindowManager(mSystemWindows);
// No need to listen to display window container or create root tasks if the device is not
// using legacy split screen.
if (!context.getResources().getBoolean(com.android.internal.R.bool.config_useLegacySplit)) {
return;
}
mDisplayController.addDisplayWindowListener(this);
// Don't initialize the divider or anything until we get the default display.

View File

@@ -78,7 +78,6 @@ import android.window.TransitionRequestInfo;
import android.window.WindowContainerToken;
import android.window.WindowContainerTransaction;
import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.logging.InstanceId;
import com.android.internal.protolog.common.ProtoLog;
@@ -157,10 +156,6 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
private boolean mExitSplitScreenOnHide;
private boolean mKeyguardOccluded;
// TODO(b/187041611): remove this flag after totally deprecated legacy split
/** Whether the device is supporting legacy split or not. */
private boolean mUseLegacySplit;
@SplitScreen.StageType
private int mDismissTop = NO_DISMISS;
@@ -735,17 +730,9 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
private void onStageRootTaskAppeared(StageListenerImpl stageListener) {
if (mMainStageListener.mHasRootTask && mSideStageListener.mHasRootTask) {
mUseLegacySplit = mContext.getResources().getBoolean(R.bool.config_useLegacySplit);
final WindowContainerTransaction wct = new WindowContainerTransaction();
// Make the stages adjacent to each other so they occlude what's behind them.
wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
// Only sets side stage as launch-adjacent-flag-root when the device is not using legacy
// split to prevent new split behavior confusing users.
if (!mUseLegacySplit) {
wct.setLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token);
}
mTaskOrganizer.applyTransaction(wct);
}
}
@@ -755,11 +742,6 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
final WindowContainerTransaction wct = new WindowContainerTransaction();
// Deactivate the main stage if it no longer has a root task.
mMainStage.deactivate(wct);
if (!mUseLegacySplit) {
wct.clearLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token);
}
mTaskOrganizer.applyTransaction(wct);
}
}

View File

@@ -37,6 +37,7 @@ import android.window.WindowContainerTransaction;
import androidx.annotation.NonNull;
import com.android.internal.R;
import com.android.launcher3.icons.IconProvider;
import com.android.wm.shell.ShellTaskOrganizer;
import com.android.wm.shell.common.SurfaceUtils;
@@ -102,7 +103,12 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
mSurfaceSession = surfaceSession;
mIconProvider = iconProvider;
mStageTaskUnfoldController = stageTaskUnfoldController;
taskOrganizer.createRootTask(displayId, WINDOWING_MODE_MULTI_WINDOW, this);
// No need to create root task if the device is using legacy split screen.
// TODO(b/199236198): Remove this check after totally deprecated legacy split.
if (!context.getResources().getBoolean(R.bool.config_useLegacySplit)) {
taskOrganizer.createRootTask(displayId, WINDOWING_MODE_MULTI_WINDOW, this);
}
}
int getChildCount() {