Merge "Fix wrong divider bar layering" into sc-v2-dev
This commit is contained in:
@@ -172,6 +172,14 @@ public class LegacySplitScreenController implements DisplayController.OnDisplays
|
|||||||
};
|
};
|
||||||
|
|
||||||
mWindowManager = new DividerWindowManager(mSystemWindows);
|
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);
|
mDisplayController.addDisplayWindowListener(this);
|
||||||
// Don't initialize the divider or anything until we get the default display.
|
// Don't initialize the divider or anything until we get the default display.
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ import android.window.TransitionRequestInfo;
|
|||||||
import android.window.WindowContainerToken;
|
import android.window.WindowContainerToken;
|
||||||
import android.window.WindowContainerTransaction;
|
import android.window.WindowContainerTransaction;
|
||||||
|
|
||||||
import com.android.internal.R;
|
|
||||||
import com.android.internal.annotations.VisibleForTesting;
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.logging.InstanceId;
|
import com.android.internal.logging.InstanceId;
|
||||||
import com.android.internal.protolog.common.ProtoLog;
|
import com.android.internal.protolog.common.ProtoLog;
|
||||||
@@ -157,10 +156,6 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
private boolean mExitSplitScreenOnHide;
|
private boolean mExitSplitScreenOnHide;
|
||||||
private boolean mKeyguardOccluded;
|
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
|
@SplitScreen.StageType
|
||||||
private int mDismissTop = NO_DISMISS;
|
private int mDismissTop = NO_DISMISS;
|
||||||
|
|
||||||
@@ -735,17 +730,9 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
|
|
||||||
private void onStageRootTaskAppeared(StageListenerImpl stageListener) {
|
private void onStageRootTaskAppeared(StageListenerImpl stageListener) {
|
||||||
if (mMainStageListener.mHasRootTask && mSideStageListener.mHasRootTask) {
|
if (mMainStageListener.mHasRootTask && mSideStageListener.mHasRootTask) {
|
||||||
mUseLegacySplit = mContext.getResources().getBoolean(R.bool.config_useLegacySplit);
|
|
||||||
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||||
// Make the stages adjacent to each other so they occlude what's behind them.
|
// Make the stages adjacent to each other so they occlude what's behind them.
|
||||||
wct.setAdjacentRoots(mMainStage.mRootTaskInfo.token, mSideStage.mRootTaskInfo.token);
|
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);
|
mTaskOrganizer.applyTransaction(wct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -755,11 +742,6 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
|||||||
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
final WindowContainerTransaction wct = new WindowContainerTransaction();
|
||||||
// Deactivate the main stage if it no longer has a root task.
|
// Deactivate the main stage if it no longer has a root task.
|
||||||
mMainStage.deactivate(wct);
|
mMainStage.deactivate(wct);
|
||||||
|
|
||||||
if (!mUseLegacySplit) {
|
|
||||||
wct.clearLaunchAdjacentFlagRoot(mSideStage.mRootTaskInfo.token);
|
|
||||||
}
|
|
||||||
|
|
||||||
mTaskOrganizer.applyTransaction(wct);
|
mTaskOrganizer.applyTransaction(wct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import android.window.WindowContainerTransaction;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import com.android.internal.R;
|
||||||
import com.android.launcher3.icons.IconProvider;
|
import com.android.launcher3.icons.IconProvider;
|
||||||
import com.android.wm.shell.ShellTaskOrganizer;
|
import com.android.wm.shell.ShellTaskOrganizer;
|
||||||
import com.android.wm.shell.common.SurfaceUtils;
|
import com.android.wm.shell.common.SurfaceUtils;
|
||||||
@@ -102,7 +103,12 @@ class StageTaskListener implements ShellTaskOrganizer.TaskListener {
|
|||||||
mSurfaceSession = surfaceSession;
|
mSurfaceSession = surfaceSession;
|
||||||
mIconProvider = iconProvider;
|
mIconProvider = iconProvider;
|
||||||
mStageTaskUnfoldController = stageTaskUnfoldController;
|
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() {
|
int getChildCount() {
|
||||||
|
|||||||
Reference in New Issue
Block a user