Re-fetch DesktopVisibilityController when needed instead of just once

When creating DesktopTaskbarRunningAppsController the Quickstep Launcher
might not be available, meaning we pass a null
DesktopVisibilityController to DesktopTaskbarRunningAppsController.
With this CL we refetch DesktopVisibilityController whenever needed.

Bug: 338035946
Test: manual, and DesktopTaskbarRunningAppsControllerTest
Flag: ACONFIG com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps DEVELOPMENT
Change-Id: I8b806e2d0addbf8fb5ab6a3d419a4691c445f223
This commit is contained in:
Gustav Sennton
2024-04-30 16:02:19 +00:00
parent 0eaf9ebdaa
commit f74d8b7264
3 changed files with 10 additions and 3 deletions

View File

@@ -54,7 +54,9 @@ class DesktopTaskbarRunningAppsControllerTest : TaskbarBaseTestCase() {
super.setup()
userHandle = Process.myUserHandle()
taskbarRunningAppsController =
DesktopTaskbarRunningAppsController(mockRecentsModel, mockDesktopVisibilityController)
DesktopTaskbarRunningAppsController(mockRecentsModel) {
mockDesktopVisibilityController
}
taskbarRunningAppsController.init(taskbarControllers)
taskbarRunningAppsController.setApps(
ALL_APP_PACKAGES.map { createTestAppInfo(packageName = it) }.toTypedArray()