diff options
| author | 2021-11-17 00:49:42 +0000 | |
|---|---|---|
| committer | 2021-11-17 00:49:42 +0000 | |
| commit | dec87d49cafbd3ecfeb3e0796281a721b34d8a31 (patch) | |
| tree | a775cc7d4fc50438edaec0d5aa103a5568fbd676 /libs | |
| parent | 34873949e90746f2465ce28fc5787f83949a736d (diff) | |
| parent | 4dd75ce7abee63080aa010e536d7fb1f74fe7518 (diff) | |
Merge "Fix wrong divider bar layering" into sc-v2-dev
Diffstat (limited to 'libs')
3 files changed, 15 insertions, 19 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java index 80ab166d0649..67e487de0993 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/legacysplitscreen/LegacySplitScreenController.java @@ -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. diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java index 050d255bfd2d..d4941916850d 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageCoordinator.java @@ -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); } } diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java index 190006ec0d9b..62b8638a2582 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/splitscreen/StageTaskListener.java @@ -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() { |