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
diff --git a/android/TerminalApp/res/values/strings.xml b/android/TerminalApp/res/values/strings.xml
index d498286..68551a0 100644
--- a/android/TerminalApp/res/values/strings.xml
+++ b/android/TerminalApp/res/values/strings.xml
@@ -20,6 +20,13 @@
     <!-- Application name of this terminal app shown in the launcher. This app provides computer terminal to connect to virtual machine. [CHAR LIMIT=16] -->
     <string name="app_name">Terminal</string>
 
+    <!-- Description of the entire terminal display showing texts. This is read by talkback. -->
+    <string name="terminal_display">Terminal display</string>
+    <!-- Description of the edit box accepting user input. This is read by talkback. -->
+    <string name="terminal_input">Cursor</string>
+    <!-- Description of an empty line in the terminal. This is read by talkback. -->
+    <string name="empty_line">Empty line</string>
+
     <!-- Installer activity title [CHAR LIMIT=none] -->
     <string name="installer_title_text">Install Linux terminal</string>
     <!-- Installer activity description format [CHAR LIMIT=none] -->