diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt index a00db5eb76..ab502451ac 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarDesktopModeController.kt @@ -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 diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt index bc3dc53aa0..8176920ec7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarRecentAppsController.kt @@ -269,7 +269,11 @@ class TaskbarRecentAppsController( desktopTasks = allRecentTasks.filterIsInstance().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) { diff --git a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt index 35409dbd8a..c119572d15 100644 --- a/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt +++ b/quickstep/tests/multivalentTests/src/com/android/launcher3/taskbar/TaskbarRecentAppsControllerTest.kt @@ -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