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

Commit 2fbf167a authored by Matt Sziklay's avatar Matt Sziklay Committed by Android (Google) Code Review
Browse files

Merge "Perform view model onTaskInfoChanged after split animation." into main

parents f8338ad2 57f15aaf
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -34,7 +34,6 @@ import static android.view.WindowManager.transitTypeToString;
import static android.window.TransitionInfo.FLAG_IS_DISPLAY;
import static android.window.WindowContainerTransaction.HierarchyOp.HIERARCHY_OP_TYPE_REORDER;

import static com.android.wm.shell.Flags.enableFlexibleSplit;
import static com.android.wm.shell.common.split.SplitLayout.PARALLAX_ALIGN_CENTER;
import static com.android.wm.shell.common.split.SplitScreenUtils.reverseSplitPosition;
import static com.android.wm.shell.common.split.SplitScreenUtils.splitFailureMessage;
@@ -1668,7 +1667,6 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
        if (mRootTaskInfo == null || mRootTaskInfo.taskId != taskInfo.taskId) {
            throw new IllegalArgumentException(this + "\n Unknown task info changed: " + taskInfo);
        }
        mWindowDecorViewModel.ifPresent(viewModel -> viewModel.onTaskInfoChanged(taskInfo));
        mRootTaskInfo = taskInfo;
        if (mSplitLayout != null
                && mSplitLayout.updateConfiguration(mRootTaskInfo.configuration)
@@ -2822,6 +2820,10 @@ public class StageCoordinator implements SplitLayout.SplitLayoutHandler,
                mSplitLayout.flingDividerToCenter(this::notifySplitAnimationFinished);
            }
            callbackWct.setReparentLeafTaskIfRelaunch(mRootTaskInfo.token, false);
            mWindowDecorViewModel.ifPresent(viewModel -> {
                viewModel.onTaskInfoChanged(finalMainChild.getTaskInfo());
                viewModel.onTaskInfoChanged(finalSideChild.getTaskInfo());
            });
            mPausingTasks.clear();
        });

+16 −1
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ import static com.android.wm.shell.desktopmode.DesktopModeVisualIndicator.Indica
import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_DESKTOP_MODE;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_BOTTOM_OR_RIGHT;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_TOP_OR_LEFT;
import static com.android.wm.shell.shared.split.SplitScreenConstants.SPLIT_POSITION_UNDEFINED;
import static com.android.wm.shell.splitscreen.SplitScreen.STAGE_TYPE_UNDEFINED;

import android.annotation.NonNull;
@@ -1103,8 +1104,22 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                        // If we are entering split select, handle will no longer be visible and
                        // should not be receiving any input.
                        if (resultType == TO_SPLIT_LEFT_INDICATOR
                                || resultType != TO_SPLIT_RIGHT_INDICATOR) {
                                || resultType == TO_SPLIT_RIGHT_INDICATOR) {
                            relevantDecor.disposeStatusBarInputLayer();
                            // We should also dispose the other split task's input layer if
                            // applicable.
                            final int splitPosition = mSplitScreenController
                                    .getSplitPosition(relevantDecor.mTaskInfo.taskId);
                            if (splitPosition != SPLIT_POSITION_UNDEFINED) {
                                final int oppositePosition =
                                        splitPosition == SPLIT_POSITION_TOP_OR_LEFT
                                                ? SPLIT_POSITION_BOTTOM_OR_RIGHT
                                                : SPLIT_POSITION_TOP_OR_LEFT;
                                final RunningTaskInfo oppositeTaskInfo =
                                        mSplitScreenController.getTaskInfo(oppositePosition);
                                mWindowDecorByTaskId.get(oppositeTaskInfo.taskId)
                                        .disposeStatusBarInputLayer();
                            }
                        }
                        mMoveToDesktopAnimator = null;
                        return;