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

Commit 806bcfa2 authored by Orhan Uysal's avatar Orhan Uysal
Browse files

Remove moveToDesktopWithoutDecor.

Since ag/26154333 we no longer need decor to move to desktop by default.

Test: adb shell dumpsys activity service SystemUIService WMShell
    desktopmode moveToDesktop <taskId> moves task to desktop
Bug: 325041803
Change-Id: I1aae38d422dba9745c6dd5815e8bab667fc458aa
parent 61873aab
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -58,7 +58,7 @@ class DesktopModeShellCommandHandler(private val controller: DesktopTasksControl
            return false
        }

        return controller.moveToDesktopWithoutDecor(taskId, WindowContainerTransaction())
        return controller.moveToDesktop(taskId, WindowContainerTransaction())
    }

    override fun printShellCommandHelp(pw: PrintWriter, prefix: String) {
+2 −35
Original line number Diff line number Diff line
@@ -244,46 +244,13 @@ class DesktopTasksController(
    fun moveToDesktop(
            taskId: Int,
            wct: WindowContainerTransaction = WindowContainerTransaction()
    ) {
    ): Boolean {
        shellTaskOrganizer.getRunningTaskInfo(taskId)?.let {
            task -> moveToDesktop(task, wct)
        }
    }

    /** Move a task with given `taskId` to desktop without decor */
    fun moveToDesktopWithoutDecor(
        taskId: Int,
        wct: WindowContainerTransaction
    ): Boolean {
        val task = shellTaskOrganizer.getRunningTaskInfo(taskId) ?: return false
        moveToDesktopWithoutDecor(task, wct)
        } ?: return false
        return true
    }

    /**
     * Move a task to desktop without decor
     */
    private fun moveToDesktopWithoutDecor(
        task: RunningTaskInfo,
        wct: WindowContainerTransaction
    ) {
        KtProtoLog.v(
            WM_SHELL_DESKTOP_MODE,
            "DesktopTasksController: moveToDesktopWithoutDecor taskId=%d",
            task.taskId
        )
        exitSplitIfApplicable(wct, task)
        // Bring other apps to front first
        bringDesktopAppsToFront(task.displayId, wct)
        addMoveToDesktopChanges(wct, task)

        if (Transitions.ENABLE_SHELL_TRANSITIONS) {
            transitions.startTransition(TRANSIT_CHANGE, wct, null /* handler */)
        } else {
            shellTaskOrganizer.applyTransaction(wct)
        }
    }

    /**
     * Move a task to desktop
     */