Release the visual indicator before a new drag event if needed
DesktopModeVisualIndicator is currently throwing an IllegalArgumentException due to an instance of the visual indicator that is attempting to show a TO_DESKTOP indicator while the task is in freeform. The visual indicator decides to show the TO_DESKTOP indicator because DesktopModeVisualIndicator#mStartDragState is not set to DragStartState.FROM_FREEFORM (see DesktopModeVisualIndicator#updateVisualIndicator). However, when DesktopTaskCoordinator#onDragPositioningEnd is called, the task is in freeform already which means the TO_DESKTOP indicator should not be allowed to show. This change clears the visual indicator saved in DesktopTasksCoordinator id a new DragStartState is encountered (which means a new drag event has started while the indicator has not yet been cleared). This may be happening because clearing the indicator is tied to shell transitions. So, if the transition does not finish by the time the new drag event starts, the old indicator with the old DragStartState will be used which might be causing this incorrect state. Bug: 394021523 Test: drag task around and to/from fullscreen Flag: com.android.window.flags.enable_desktop_windowing_mode Change-Id: I90c376090978d28852fdab9969ff3644ebcfd7e6
Loading
Please register or sign in to comment