[Desktop Mode] Show indicators under Taskbar app icons for running apps

In Desktop Mode we show running Desktop apps in the Taskbar. With this
change we also show an indicator under the app icon for each such
running app.

Bug: 332504528
Test: manual
Test: DesktopTaskbarRunningAppsControllerTest
Flag: ACONFIG com.android.window.flags.Flags.enableDesktopWindowingTaskbarRunningApps DEVELOPMENT
Change-Id: If0906dab8ad0bd8a78d93a4e99db47550e763bed
This commit is contained in:
Gustav Sennton
2024-04-12 14:19:12 +00:00
parent 4e741082dc
commit 52a8b7e24b
11 changed files with 124 additions and 4 deletions

View File

@@ -154,6 +154,29 @@ class DesktopTaskbarRunningAppsControllerTest : TaskbarBaseTestCase() {
assertThat(newHotseatItems?.map { it.targetPackage }).isEqualTo(expectedPackages)
}
@Test
fun getRunningApps_notInDesktopMode_returnsEmptySet() {
setInDesktopMode(false)
val runningTasks =
createDesktopTasksFromPackageNames(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
taskbarRunningAppsController.updateRunningApps(createSparseArray(emptyList()))
assertThat(taskbarRunningAppsController.runningApps).isEqualTo(emptySet<String>())
}
@Test
fun getRunningApps_inDesktopMode_returnsRunningApps() {
setInDesktopMode(true)
val runningTasks =
createDesktopTasksFromPackageNames(listOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
whenever(mockRecentsModel.runningTasks).thenReturn(runningTasks)
taskbarRunningAppsController.updateRunningApps(createSparseArray(emptyList()))
assertThat(taskbarRunningAppsController.runningApps)
.isEqualTo(setOf(RUNNING_APP_PACKAGE_1, RUNNING_APP_PACKAGE_2))
}
private fun createHotseatItemsFromPackageNames(packageNames: List<String>): List<ItemInfo> {
return packageNames.map { createTestAppInfo(packageName = it) }
}