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

Commit f68e3826 authored by Jorge Gil's avatar Jorge Gil Committed by Android (Google) Code Review
Browse files

Merge "[2/N] Desks: Add multi-desk data structures" into main

parents bbccaf6f 2e3ca633
Loading
Loading
Loading
Loading
+579 −149

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -2231,7 +2231,7 @@ class DesktopTasksController(
    fun removeDesktop(displayId: Int) {
        if (!DesktopModeFlags.ENABLE_DESKTOP_WINDOWING_BACK_NAVIGATION.isTrue()) return

        val tasksToRemove = taskRepository.removeDesktop(displayId)
        val tasksToRemove = taskRepository.removeDesk(displayId)
        val wct = WindowContainerTransaction()
        tasksToRemove.forEach {
            val task = shellTaskOrganizer.getRunningTaskInfo(it)
+2 −2
Original line number Diff line number Diff line
@@ -1046,14 +1046,14 @@ class DesktopRepositoryTest : ShellTestCase() {
    }

    @Test
    fun removeDesktop_multipleTasks_removesAll() {
    fun removeDesk_multipleTasks_removesAll() {
        // The front-most task will be the one added last through `addTask`.
        repo.addTask(displayId = DEFAULT_DISPLAY, taskId = 3, isVisible = true)
        repo.addTask(displayId = DEFAULT_DISPLAY, taskId = 2, isVisible = true)
        repo.addTask(displayId = DEFAULT_DISPLAY, taskId = 1, isVisible = true)
        repo.minimizeTask(displayId = DEFAULT_DISPLAY, taskId = 2)

        val tasksBeforeRemoval = repo.removeDesktop(displayId = DEFAULT_DISPLAY)
        val tasksBeforeRemoval = repo.removeDesk(displayId = DEFAULT_DISPLAY)

        assertThat(tasksBeforeRemoval).containsExactly(1, 2, 3).inOrder()
        assertThat(repo.getActiveTasks(displayId = DEFAULT_DISPLAY)).isEmpty()