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

Commit 9e476782 authored by Matthew Mourgos's avatar Matthew Mourgos
Browse files

Avoid launching home intent on cleanup when home shown behind desktop

Bug: 437189611
Test: Close last open window above homescreen or -1 screen
Flag: com.android.window.flags.show_home_behind_desktop
Change-Id: Iea3ea199ebeae89f0ce2bc53d9ac682510f15876
parent b84ec57b
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -3188,10 +3188,11 @@ class DesktopTasksController(
                shouldEndUpAtHome,
            )
        }
        if (
            !skipWallpaperAndHomeOrdering ||
                !DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue
        ) {
        val shouldHandleWallpaperAndHome =
            (!skipWallpaperAndHomeOrdering ||
                !DesktopExperienceFlags.ENABLE_MULTIPLE_DESKTOPS_BACKEND.isTrue) &&
                !desktopState.shouldShowHomeBehindDesktop
        if (shouldHandleWallpaperAndHome) {
            if (ENABLE_DESKTOP_WALLPAPER_ACTIVITY_FOR_SYSTEM_USER.isTrue) {
                moveWallpaperActivityToBack(wct, displayId)
            } else {
+12 −0
Original line number Diff line number Diff line
@@ -4560,6 +4560,18 @@ class DesktopTasksControllerTest(flags: FlagsParameterization) : ShellTestCase()
        assertThat(wct.hierarchyOps).isEmpty()
    }

    @Test
    @EnableFlags(Flags.FLAG_SHOW_HOME_BEHIND_DESKTOP)
    fun onDesktopWindowClose_singleActiveTask_showHomeBehindDesktop_doesNotLaunchHome() {
        desktopState.shouldShowHomeBehindDesktop = true
        val task = setUpFreeformTask()
        val wct = WindowContainerTransaction()

        controller.onDesktopWindowClose(wct, displayId = DEFAULT_DISPLAY, task)

        wct.assertWithoutPendingIntent(launchHomeIntent(DEFAULT_DISPLAY))
    }

    @Test
    fun tilingBroken_onTaskMinimised() {
        val task = setUpFreeformTask()