mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Problem: The framework prevents a key gesture handler from being re-registered by the same process ID. In `TaskbarAutohideSuspendControllerTest`, we observed two calls to `QuickstepKeyGestureEventsManager#registerAllAppsKeyGestureEvent`. The first call originated from TouchInteractionService (as expected). The second, however, came from a new TaskbarManager instance created within `TaskbarbarUnitTestRule`. This occurs because `TaskManager#recreateTaskbarForDisplay` triggers `AllAppsActionManager#isTaskbarPresent`, which ultimately leads to the duplicate call to `QuickstepKeyGestureEventsManager#registerAllAppsKeyGestureEvent`. Solution: Since this problem only occurs in tests and not in practice, we can mock out `QuickstepKeyGestureEventsManager`'s [un]registration calls to do nothing within `TaskbarbarUnitTestRule` to prevent duplicated re-registration. Flag: com.android.window.flags.grant_manage_key_gestures_to_recents Test: atest NexusLauncherTests:TaskbarAutohideSuspendControllerTest Test: atest NexusLauncherTests:TaskbarEduTooltipControllerTest Fix: 421853013 Change-Id: Ic87bd8d36ce018935002b8698b1d53e30b2fca6d