Use desktop mode autostashing on desktop devices

Updates few autostashing related conditions to use
`isTaskbarShowingDesktopApps()` instead of `isInDesktopMode()`, as the
former covers the case where the desktop flavour taskbar is shown
consistently (on desktop devices).

Bug: 390665752
Bug: 415991381
Flag: com.android.window.flags.enable_desktop_taskbar_on_freeform_displays
Test: On desktop device, verify that "Always show taskbar" is shown on
      home/in overview/in app outside desktop mode, and verify that the popup
      value shown is consistent with the value in desktop mode. Verify
      that taskbar does not get auto-stashed on home, even if "Always
      show Taskbar" value is false.
Change-Id: I4edfe20f5526210fdf767231d0906875fe04f806
This commit is contained in:
Toni Barzic
2025-05-03 23:04:22 +00:00
parent 37437bafc5
commit 2cf0d817a3
5 changed files with 38 additions and 6 deletions

View File

@@ -76,6 +76,19 @@ class TaskbarPinningControllerTest : TaskbarBaseTestCase() {
)
)
.thenAnswer { _ -> isInDesktopMode }
whenever(
taskbarControllers.taskbarDesktopModeController.isInDesktopMode(
taskbarActivityContext.displayId
)
)
.thenAnswer { _ -> isInDesktopMode }
whenever(
taskbarControllers.taskbarDesktopModeController.shouldShowDesktopTasksInTaskbar(
taskbarActivityContext.displayId
)
)
.thenAnswer { _ -> isInDesktopMode }
pinningController = spy(TaskbarPinningController(taskbarActivityContext))
pinningController.init(taskbarControllers, taskbarSharedState)
}