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

Skip to content
Commit f163deb7 authored by sallyyuen's avatar sallyyuen
Browse files

Add accessibility support for Drag & Drop

go/a11yDragAndDrop

Add AccessibilityAction#ACTION_DROP to potential drop targets.
Add A11yAction#ACTION_CANCEL to the source of the drag.
Developers will be required add the A11yAction#ACTION_DRAG action
(androidX can do this)

Send AccessibilityEvents when appropriate. These events will be
sent when a drag is performed via a11y actions, or via touch events
with a11y enabled.

Drop and cancel events are mutuall exclusive.

To avoid a scenario where a user starts a drag via an a11yAction but
doesn't drop or cancel, the system will cancel the event after a minute
timeout.

Corner cases:
1) A user cannot start a drag on another view without first cancelling
the current one

2) An ACTION_DRAG on a View won't be successful if the last touch point
was in that View

For a11y, we send window events directly from the View to avoid source
merging in ViewRootImpl. (Specifically for the start events, where the
event gets sent from the common ancestor of the source and target
instead of the source)

Bug: 26871588
Test: atest DragDropControllerTests CtsWindowManagerDeviceTestCases:CrossAppDragAndDropTests AccessibilityDragAndDropTest
Use Android's official sample drag and drop apps. Drag within window and across split screens
Use ReceiveContentDemo target app with sample app

Change-Id: Ie8554d25ab6c43b08d2dacb8c8907b1636bd72b4
parent cd9481d2
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