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

Commit baf2c31a authored by Orhan Uysal's avatar Orhan Uysal Committed by Android (Google) Code Review
Browse files

Merge "Remove desktop tasks on back navigation." into main

parents 7e1f8682 ab9561c7
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -1045,14 +1045,12 @@ class DesktopTasksController(

    /** Handle task closing by removing wallpaper activity if it's the last active task */
    private fun handleTaskClosing(task: RunningTaskInfo): WindowContainerTransaction? {
        val wct = if (
            desktopModeTaskRepository.isOnlyVisibleNonClosingTask(task.taskId) &&
                desktopModeTaskRepository.wallpaperActivityToken != null
        ) {
        ProtoLog.v(WM_SHELL_DESKTOP_MODE, "DesktopTasksController: handleTaskClosing")
        val wct = WindowContainerTransaction()
        if (desktopModeTaskRepository.isOnlyVisibleNonClosingTask(task.taskId)
            && desktopModeTaskRepository.wallpaperActivityToken != null) {
            // Remove wallpaper activity when the last active task is removed
            WindowContainerTransaction().also { wct -> removeWallpaperActivity(wct) }
        } else {
            null
            removeWallpaperActivity(wct)
        }
        if (!desktopModeTaskRepository.addClosingTask(task.displayId, task.taskId)) {
            // Could happen if the task hasn't been removed from closing list after it disappeared
@@ -1062,7 +1060,12 @@ class DesktopTasksController(
                task.taskId
            )
        }
        return wct
        // If a CLOSE or TO_BACK is triggered on a desktop task, remove the task.
        if (Flags.enableDesktopWindowingBackNavigation() &&
            desktopModeTaskRepository.isVisibleTask(task.taskId)) {
            wct.removeTask(task.token)
        }
        return if (wct.isEmpty) null else wct
    }

    private fun addMoveToDesktopChanges(
+272 −43

File changed.

Preview size limit exceeded, changes collapsed.