Add hidden flag for SysUI to control the return drag animation
- When a drag is not dropped or the drop is not consumed, the system will
play a canned animation to the origin of the drag. However, there are
scenarios where this is not sufficient (ie. dragging from a folder or
all apps in the taskbar, which are closed once global drag starts). As
a result, the return animation will return to the wrong location.
The CL adds a hidden flag DRAG_FLAG_REQUEST_SURFACE_FOR_RETURN_ANIMATION
which only SysUI can request (protected by START_TASKS_FROM_RECENTS)
which indicates to the system that when a return animation is to be
played, it should defer to the calling app to animate the surface
instead.
The surface will be returned with the DRAG_ENDED event only if the
result is false (a return animation), to ensure that it does not
collide with the DROP animation by the Shell. The system will
also continue to schedule a timeout to clear the surface if the
caller does not handle it correctly.
Bug: 179390870
Test: atest DragDropControllerTests
Change-Id: I65d749f9fba186a0e43e155bebb136926642a90a
5 files changed