Ignore focus event for digits field
On app launch digits field may have a focus, and the focus event
makes tts speak both the app name and the type of the View in a row
"phone, edit box"). This change suppresses the second part and let
tts speak just the app name on launch ("phone").
Bug: 5275935
Change-Id: Ideb62b01104a1701c71ca7af0d6fa05d8cc39657
diff --git a/src/com/android/contacts/dialpad/DigitsEditText.java b/src/com/android/contacts/dialpad/DigitsEditText.java
index 983b7db..753afd4 100644
--- a/src/com/android/contacts/dialpad/DigitsEditText.java
+++ b/src/com/android/contacts/dialpad/DigitsEditText.java
@@ -62,6 +62,10 @@
// AsYouTypeFormatter frequently replaces digits with formatted ones, which makes
// tts too verbose. Let's ignore the whole event.
return;
+ } else if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_FOCUSED) {
+ // The parent EditText class lets tts read "edit box" when this View has a focus, which
+ // confuses users on app launch (issue 5275935).
+ return;
}
super.sendAccessibilityEventUnchecked(event);
}