Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 78de7961 authored by Winson Chung's avatar Winson Chung
Browse files

Add support for delegating unhandled drags to SystemUI

- This CL adds two public flags that are used with drag and drop:
  DRAG_FLAG_GLOBAL_SAME_APPLICATION which allows cross-window drag and
  drop between windows of the same app (by uid), and
  DRAG_FLAG_START_INTENT_ON_UNHANDLED_DRAG which allows the system to
  delegate drags that are not handled by any app window to the SystemUI
  for handling (if the current state of the device supports it)
- On the system side, it exposes a way for SysUI to register itself
  as an unhandled drag listener, and modifies the drag and drop flow
  to allow for WM to call the listener when an unhandled drag is
  detected.  In this case in particular, ACTION_DRAG_ENDED will now be
  deferred until the unhandled listener calls back.

  ie.
  For a normal drop over a window that handles it:
  ... -> Input reports drop over window
      -> ACTION_DROP sent to target window
      -> Window reports drop consumed to WM
      -> DRAG_ENDED (result=true) to all notified windows

  For a normal drop over a window that does not handle it:
  ... -> Input reports drop over window
      -> ACTION_DROP to target window
      -> Window reports drop not consumed to WM
      -> Unhandled drag listener notified of drop, reports consumed to WM
      -> DRAG_ENDED (result=unhandled consumed) to all notified windows

  For an unhandled drag over no window
  ... -> Input reports drop over window (but window was not valid target)
      -> Unhandled drag listener notified of drop, reports consumed to WM
      -> DRAG_ENDED (result=unhandled consumed) to all notified windows

  All other existing drag and drop behavior is the same as before

Bug: 320797628
API-Coverage-Bug: 324480328
Test: atest DragDropTest DragDropControllerTests CrossAppDragAndDropTests
Change-Id: Icc42f28e30cf976e5068c12e071942fcc61ee965
parent 35292e51
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment