From b5d2f3ee7fd9308856b38faec6dd27926afe3cd2 Mon Sep 17 00:00:00 2001 From: Jagrut Desai Date: Tue, 27 May 2025 16:05:21 -0700 Subject: [PATCH] Fix Hotseat flashing during DW to home transition Problem: upon exiting the deesktop mode we were getting change in recents tasks which we were commiting to ui and that resulted in hotseat flashing. Solution: since layout transition is only in use while we are in desktop windowing mode, we will only need to change icon layout bound while we are in desktop mode and not when we are exiting. Test: Manual, Presubmit Bug: 417696108 Bug: 415700104 Flag: EXEMPT bugfix Change-Id: Ibcf65df49e7b48312a27d2750d3d0c6c5d392006 --- .../launcher3/taskbar/TaskbarDesktopModeController.kt | 3 +++ .../launcher3/taskbar/TaskbarRecentAppsController.kt | 6 +++++- .../launcher3/taskbar/TaskbarRecentAppsControllerTest.kt | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) 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