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

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

Merge "Allow split apps to use fullscreen button." into main

parents 7412123a 82f73a4a
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -343,9 +343,8 @@ class DesktopTasksController(
            task.taskId
        )
        val wct = WindowContainerTransaction()
        wct.setWindowingMode(task.token, WINDOWING_MODE_MULTI_WINDOW)
        wct.setBounds(task.token, Rect())
        wct.setDensityDpi(task.token, getDefaultDensityDpi())
        addMoveToSplitChanges(wct, task)
        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
            transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
        } else {
@@ -827,7 +826,9 @@ class DesktopTasksController(
        wct: WindowContainerTransaction,
        taskInfo: RunningTaskInfo
    ) {
        wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_MULTI_WINDOW)
        // Explicitly setting multi-window at task level interferes with animations.
        // Let task inherit windowing mode once transition is complete instead.
        wct.setWindowingMode(taskInfo.token, WINDOWING_MODE_UNDEFINED)
        // The task's density may have been overridden in freeform; revert it here as we don't
        // want it overridden in multi-window.
        wct.setDensityDpi(taskInfo.token, getDefaultDensityDpi())
+10 −5
Original line number Diff line number Diff line
@@ -82,6 +82,7 @@ import com.android.wm.shell.freeform.FreeformTaskTransitionStarter;
import com.android.wm.shell.recents.RecentsTransitionHandler;
import com.android.wm.shell.recents.RecentsTransitionStateListener;
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;
@@ -238,7 +239,7 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
        mSplitScreenController = splitScreenController;
        mSplitScreenController.registerSplitScreenListener(new SplitScreen.SplitScreenListener() {
            @Override
            public void onTaskStageChanged(int taskId, int stage, boolean visible) {
            public void onTaskStageChanged(int taskId, @StageType int stage, boolean visible) {
                if (visible) {
                    DesktopModeWindowDecoration decor = mWindowDecorByTaskId.get(taskId);
                    if (decor != null && DesktopModeStatus.isEnabled()
@@ -391,10 +392,10 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
            final DesktopModeWindowDecoration decoration = mWindowDecorByTaskId.get(mTaskId);
            final int id = v.getId();
            if (id == R.id.close_window) {
                mTaskOperations.closeTask(mTaskToken);
                if (isTaskInSplitScreen(mTaskId)) {
                    RunningTaskInfo remainingTask = getOtherSplitTask(mTaskId);
                    mSplitScreenController.moveTaskToFullscreen(remainingTask.taskId);
                    mSplitScreenController.moveTaskToFullscreen(getOtherSplitTask(mTaskId).taskId);
                } else {
                    mTaskOperations.closeTask(mTaskToken);
                }
            } else if (id == R.id.back_button) {
                mTaskOperations.injectBackKey();
@@ -417,8 +418,12 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
                }
                decoration.closeHandleMenu();
            } else if (id == R.id.fullscreen_button) {
                mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId));
                decoration.closeHandleMenu();
                if (isTaskInSplitScreen(mTaskId)) {
                    mSplitScreenController.moveTaskToFullscreen(mTaskId);
                } else {
                    mDesktopTasksController.ifPresent(c -> c.moveToFullscreen(mTaskId));
                }
            } else if (id == R.id.split_screen_button) {
                decoration.closeHandleMenu();
                mDesktopTasksController.ifPresent(c -> {