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

Commit 96d7dfb3 authored by Sergey Pinkevich's avatar Sergey Pinkevich
Browse files

Handle close transition for Chrome Manage Windows menu

Bug: 403345083
Flag: com.android.window.flags.enable_desktop_close_task_animation_in_dtc_bugfix
Test: atest WMShellUnitTests:DesktopTasksControllerTest

Change-Id: Ieddc1c561c8bdef58f1332cfd31cf2606dd94dd2
parent 761eb181
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2603,6 +2603,10 @@ class DesktopTasksController(
            snapEventHandler.removeTaskIfTiled(task.displayId, task.taskId)
        }

        if (DesktopExperienceFlags.ENABLE_DESKTOP_CLOSE_TASK_ANIMATION_IN_DTC_BUGFIX.isTrue) {
            addPendingCloseTransition(transition)
        }

        taskbarDesktopTaskListener?.onTaskbarCornerRoundingUpdate(
            doesAnyTaskRequireTaskbarRounding(task.displayId, task.taskId)
        )
@@ -2893,6 +2897,12 @@ class DesktopTasksController(
        )
    }

    private fun addPendingCloseTransition(transition: IBinder) {
        desktopMixedTransitionHandler.addPendingMixedTransition(
            DesktopMixedTransitionHandler.PendingMixedTransition.Close(transition)
        )
    }

    private fun activateDefaultDeskInDisplay(
        displayId: Int,
        remoteTransition: RemoteTransition? = null,
+16 −0
Original line number Diff line number Diff line
@@ -5198,6 +5198,22 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
            .assertReorderAt(index = 0, wallpaperToken, toTop = false)
    }

    @Test
    @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_CLOSE_TASK_ANIMATION_IN_DTC_BUGFIX)
    fun handleRequest_closeTransition_addPendingMixedTransition() {
        val task1 = setUpFreeformTask(displayId = DEFAULT_DISPLAY)
        val task2 = setUpFreeformTask(displayId = DEFAULT_DISPLAY)
        val transition = Binder()

        taskRepository.addTask(DEFAULT_DISPLAY, taskId = 1, isVisible = true)
        controller.handleRequest(transition, createTransition(task2, type = TRANSIT_CLOSE))

        verify(desktopMixedTransitionHandler)
            .addPendingMixedTransition(
                DesktopMixedTransitionHandler.PendingMixedTransition.Close(transition)
            )
    }

    @Test
    @EnableFlags(
        Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY,