Set hint for some UI elements

In the ttyd UI, the edit box (cursor) is the only elements that supports
action. However, it's too tiny, so users may find it difficult to set
the a11y focus on it using explore-by-touch. Even with gestures (swipe
next/prev), the cursor is hard to reach because it's located in the very
end of the traversal order; user has to go through 30-40 elements each
of which is for a line in the terminal.

To fix this issue, ttyd seems to have implemented a feature that double
tapping anywhere in the terminal UI screen activates the edit box
directly.

This however may confuse accessibility users because, they didn't hear
that double tapping action is provided. This is b/376827536.

We tried hard to fix this issue correctly; by adding ACTION_CLICK to the
other UI elements, and many more attempts, but all failed. For example,
adding ACTION_CLICK made talkback to announce "double-tap to activate",
but actually double-tapping the screen didn't lead user to the cursor.
This is probably because the click action is consumed by the other UI
elements, not the edit box.

To work around these limitations, this change uses hint text to let the
users know that double tapping will go to the cursor directly.

Bug: 376827536
Test: follow the instruction.
Change-Id: I57a3f3673209c10fdd5441229da6c0e2bf1a89dd
diff --git a/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java b/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java
index efee62f..efa3dcc 100644
--- a/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java
+++ b/android/TerminalApp/java/com/android/virtualization/terminal/TerminalView.java
@@ -216,6 +216,8 @@
                             if (id != View.NO_ID) {
                                 info.setText(null);
                                 info.setContentDescription(getString(R.string.terminal_display));
+                                // b/376827536
+                                info.setHintText(getString(R.string.double_tap_to_edit_text));
                             }
 
                             // These two lines below are to prevent this WebView element from being
@@ -230,6 +232,8 @@
                             // Localize the spoken text.
                             if (isEmptyLine(info)) {
                                 info.setContentDescription(getString(R.string.empty_line));
+                                // b/376827536
+                                info.setHintText(getString(R.string.double_tap_to_edit_text));
                             }
                             break;
                         case "android.widget.TextView":
diff --git a/android/TerminalApp/res/values/strings.xml b/android/TerminalApp/res/values/strings.xml
index da8ca84..f538873 100644
--- a/android/TerminalApp/res/values/strings.xml
+++ b/android/TerminalApp/res/values/strings.xml
@@ -26,6 +26,8 @@
     <string name="terminal_input">Cursor</string>
     <!-- Description of an empty line in the terminal. This is read by talkback. [CHAR LIMIT=none] -->
     <string name="empty_line">Empty line</string>
+    <!-- Description of the hint supported by the terminal UI elements. This is read by talkback. [CHAR LIMIT=none] -->
+    <string name="double_tap_to_edit_text">Double-tap to go to cursor</string>
 
     <!-- Installer activity title [CHAR LIMIT=none] -->
     <string name="installer_title_text">Install Linux terminal</string>