Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a60e58c authored by Jerry Chang's avatar Jerry Chang Committed by Android (Google) Code Review
Browse files

Merge "Add a flag to determin whether to support legacy split" into sc-dev

parents feb0a155 fedf86ed
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3552,6 +3552,9 @@
    -->
    <integer name="config_largeScreenSmallestScreenWidthDp">600</integer>

    <!-- True if the device is using leagacy split. -->
    <bool name="config_useLegacySplit">true</bool>

    <!-- True if the device supports running activities on secondary displays. -->
    <bool name="config_supportsMultiDisplay">true</bool>

+1 −0
Original line number Diff line number Diff line
@@ -396,6 +396,7 @@
  <java-symbol type="integer" name="config_respectsActivityMinWidthHeightMultiWindow" />
  <java-symbol type="dimen" name="config_minPercentageMultiWindowSupportWidth" />
  <java-symbol type="integer" name="config_largeScreenSmallestScreenWidthDp" />
  <java-symbol type="bool" name="config_useLegacySplit" />
  <java-symbol type="bool" name="config_noHomeScreen" />
  <java-symbol type="bool" name="config_supportsSystemDecorsOnSecondaryDisplays" />
  <java-symbol type="bool" name="config_supportsInsecureLockScreen" />
+19 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.window.TransitionRequestInfo;
import android.window.WindowContainerTransaction;


import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.protolog.common.ProtoLog;
import com.android.wm.shell.RootTaskDisplayAreaOrganizer;
@@ -110,6 +111,11 @@ class StageCoordinator implements SplitLayout.LayoutChangeListener,
    private final SplitScreenTransitions mSplitTransitions;
    private boolean mExitSplitScreenOnHide = true;

    // 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 int mDismissTop = NO_DISMISS;
    private final Runnable mOnTransitionAnimationComplete = () -> {
        // If still playing, let it finish.
@@ -334,10 +340,17 @@ class StageCoordinator implements SplitLayout.LayoutChangeListener,

    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);
        }
    }
@@ -347,7 +360,11 @@ class StageCoordinator implements SplitLayout.LayoutChangeListener,
            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);
        }
    }