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

Commit 922f8254 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Activate DesktopWallpaper when fullscreen task is forced to be freeform" into main

parents 0e827b1a d098844c
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -1689,8 +1689,11 @@ class DesktopTasksController(
            return WindowContainerTransaction().also { wct ->
                addMoveToDesktopChanges(wct, task)
                // In some launches home task is moved behind new task being launched. Make sure
                // that's not the case for launches in desktop.
                if (task.baseIntent.flags.and(Intent.FLAG_ACTIVITY_TASK_ON_HOME) != 0) {
                // that's not the case for launches in desktop. Also, if this launch is the first
                // one to trigger the desktop mode (e.g., when [forceEnterDesktop()]), activate the
                // desktop mode here.
                if (task.baseIntent.flags.and(Intent.FLAG_ACTIVITY_TASK_ON_HOME) != 0
                    || !isDesktopModeShowing(task.displayId)) {
                    bringDesktopAppsToFrontBeforeShowingNewTask(task.displayId, wct, task.taskId)
                    wct.reorder(task.token, true)
                }
+8 −2
Original line number Diff line number Diff line
@@ -1922,6 +1922,7 @@ class DesktopTasksControllerTest : ShellTestCase() {
  }

  @Test
  @EnableFlags(Flags.FLAG_ENABLE_DESKTOP_WINDOWING_WALLPAPER_ACTIVITY)
  fun handleRequest_fullscreenTask_noTasks_enforceDesktop_freeformDisplay_returnFreeformWCT() {
    whenever(DesktopModeStatus.enterDesktopByDefaultOnFreeformDisplay(context)).thenReturn(true)
    val tda = rootTaskDisplayAreaOrganizer.getDisplayAreaInfo(DEFAULT_DISPLAY)!!
@@ -1933,8 +1934,13 @@ class DesktopTasksControllerTest : ShellTestCase() {
    assertNotNull(wct, "should handle request")
    assertThat(wct.changes[fullscreenTask.token.asBinder()]?.windowingMode)
        .isEqualTo(WINDOWING_MODE_UNDEFINED)
    assertThat(wct.hierarchyOps).hasSize(1)
    wct.assertReorderAt(0, fullscreenTask, toTop = true)
    assertThat(wct.hierarchyOps).hasSize(3)
    // There are 3 hops that are happening in this case:
    // 1. Moving the fullscreen task to top as we add moveToDesktop() changes
    // 2. Pending intent for the wallpaper
    // 3. Bringing the fullscreen task back at the top
    wct.assertPendingIntentAt(1, desktopWallpaperIntent)
    wct.assertReorderAt(2, fullscreenTask, toTop = true)
  }

  @Test