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

Commit e18322e5 authored by mattsziklay's avatar mattsziklay
Browse files

Remove moveToSplit

Removes the moveToSplit function and the SplitScreenListener that calls
it. Use of this listener causes bugs and the cause of the original issue
has been corrected on Launcher side.

Bug: 338382550
Test: manual
Flag: EXEMPT bugfix
Change-Id: I5e4b03296775e263f2ad48acafb26903eccd1aa3
parent 575fff61
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -550,19 +550,6 @@ class DesktopTasksController(
        }
    }

    /** Move a desktop app to split screen. */
    fun moveToSplit(task: RunningTaskInfo) {
        logV( "moveToSplit taskId=%s", task.taskId)
        desktopTilingDecorViewModel.removeTaskIfTiled(task.displayId, task.taskId)
        val wct = WindowContainerTransaction()
        wct.setBounds(task.token, Rect())
        // Rather than set windowing mode to multi-window at task level, set it to
        // undefined and inherit from split stage.
        wct.setWindowingMode(task.token, WINDOWING_MODE_UNDEFINED)

        transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
    }

    private fun exitSplitIfApplicable(wct: WindowContainerTransaction, taskInfo: RunningTaskInfo) {
        if (splitScreenController.isTaskInSplitScreen(taskInfo.taskId)) {
            splitScreenController.prepareExitSplitScreen(
+0 −14
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ import static com.android.wm.shell.shared.desktopmode.ManageWindowsViewContainer
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;
import android.app.ActivityManager;
@@ -120,8 +119,6 @@ import com.android.wm.shell.shared.annotations.ShellMainThread;
import com.android.wm.shell.shared.desktopmode.DesktopModeStatus;
import com.android.wm.shell.shared.desktopmode.DesktopModeTransitionSource;
import com.android.wm.shell.shared.split.SplitScreenConstants.SplitPosition;
import com.android.wm.shell.splitscreen.SplitScreen;
import com.android.wm.shell.splitscreen.SplitScreen.StageType;
import com.android.wm.shell.splitscreen.SplitScreenController;
import com.android.wm.shell.sysui.KeyguardChangeListener;
import com.android.wm.shell.sysui.ShellCommandHandler;
@@ -445,17 +442,6 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel,
    @Override
    public void setSplitScreenController(SplitScreenController splitScreenController) {
        mSplitScreenController = splitScreenController;
        mSplitScreenController.registerSplitScreenListener(new SplitScreen.SplitScreenListener() {
            @Override
            public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) {
                if (visible && stage != STAGE_TYPE_UNDEFINED) {
                    DesktopModeWindowDecoration decor = mWindowDecorByTaskId.get(taskId);
                    if (decor != null && DesktopModeStatus.canEnterDesktopMode(mContext)) {
                        mDesktopTasksController.moveToSplit(decor.mTaskInfo);
                    }
                }
            }
        });
    }

    @Override