Fix many accessibility issues.

Note: this is NOT fully a11y friendly, but much better than what we hade
before. This change supports screen readers, switches, and voice
control.

This change is full of dirty hacks and fragile assumptions about ttyd.
And below is why:

TerminalView is special in two aspects. First, all the UI elements of
terminal is rendered on a WebView, not using conventional Android
widgets. It is even different from conventional custom views because
WebView is (and has to be) responsible for the generation of
AccessibilityNodeInfos and we can only hook into the process.

Second, the web UI itself looks very different from
conventional web UIs with buttons an texts. Notably, each line of the
terminal is modeled as a <div> tag in a list. The cursor is implemented
as a tiny <textarea>. WebView and Android accessibility service are not
quite ready to handle such an exotic web UI nicely.

Below is major changes done in this change.

* AccessibilityDelegate is attached to (the parent) of TerminalView so
  that we can filter out some unnecessary accessibility events such as
excessively long screen readings.

* A new AccessibilityNodeInfoProvider is put after the WebView's
  original AccessibilityNodeInfoProvider. The new provider amends
AccessibilityNodeInfos created by the the original provider with the
understanding about ttyd.

* Listen on AccessibilityStateChanges not TouchExplorationStateChanges,
  because the latter is enabled only for screen readers. To account for
switch controls, we need to listen to the global enablement of the
accessibility service.

Bug: 376205512
Bug: 376196669 (partially)
Bug: 376827536 (partially)
Bug: 376203872
Bug: 376824356
Bug: 376827479
Test: follow the test scenarios in the bugs

Change-Id: Ia36ef738165683b80387305f58a4f0c224d4d1f1
3 files changed
tree: 23a8a750c78ff8461aa4fd94bd1675430b8291d2
  1. android/
  2. build/
  3. docs/
  4. guest/
  5. libs/
  6. microfuchsia/
  7. tests/
  8. .clang-format
  9. .gitignore
  10. Android.bp
  11. dice_for_avf_guest.cddl
  12. OWNERS
  13. PREUPLOAD.cfg
  14. README.md
  15. rustfmt.toml
  16. TEST_MAPPING
README.md

Android Virtualization Framework (AVF)

Android Virtualization Framework (AVF) provides secure and private execution environments for executing code. AVF is ideal for security-oriented use cases that require stronger isolation assurances over those offered by Android’s app sandbox.

Visit our public doc site to learn more about what AVF is, what it is for, and how it is structured. This repository contains source code for userspace components of AVF.

If you want a quick start, see the getting started guideline and follow the steps there.

For in-depth explanations about individual topics and components, visit the following links.

AVF components:

AVF APIs:

How-Tos: