Merge "Fix Hotseat flashing during DW to home transition" into main

This commit is contained in:
Jagrut Desai
2025-06-03 13:06:23 -07:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 1 deletions
@@ -28,6 +28,9 @@ class TaskbarDesktopModeController(
private lateinit var taskbarControllers: TaskbarControllers
private lateinit var taskbarSharedState: TaskbarSharedState
val isLauncherAnimationRunning: Boolean
get() = desktopVisibilityController.launcherAnimationRunning
fun init(controllers: TaskbarControllers, sharedState: TaskbarSharedState) {
taskbarControllers = controllers
taskbarSharedState = sharedState
@@ -269,7 +269,11 @@ class TaskbarRecentAppsController(
desktopTasks = allRecentTasks.filterIsInstance<DesktopTask>().flatMap { it.tasks }
val runningTasksChanged = oldRunningTaskdIds != runningTaskIds
val minimizedTasksChanged = oldMinimizedTaskIds != minimizedTaskIds
if (onRecentsOrHotseatChanged() || runningTasksChanged || minimizedTasksChanged) {
if (
(onRecentsOrHotseatChanged() || runningTasksChanged || minimizedTasksChanged) &&
!controllers.taskbarDesktopModeController.isLauncherAnimationRunning
) {
controllers.taskbarViewController.commitRunningAppsToUI()
}
if (needsRecentsTasksReload) {
@@ -119,6 +119,7 @@ class TaskbarRecentAppsControllerTest : TaskbarBaseTestCase() {
recentTasksChangedListener = null
it
}
whenever(taskbarDesktopModeController.isLauncherAnimationRunning).thenReturn(false)
recentAppsController = TaskbarRecentAppsController(mockContext, mockRecentsModel)
recentAppsController.canShowRunningApps = canShowRunningAndRecentAppsAtInit
recentAppsController.canShowRecentApps = canShowRunningAndRecentAppsAtInit