Ensure *# are included in TTS spans generated with PhoneNumberUtils.

PhoneNumber utils has a method, createTtsSpan, which creates a span
for talkback to speak a phone number.  Due to a bug in Talkback it used
to strip out * and # characters.

Removing this limitation as the bug in talkback has been fixed.

Test: Manual, added unit tests
Bug: 63613215
Change-Id: I983a98a18830e32760602723e695f11e3eab9ffe
This commit is contained in:
Tyler Gunn
2017-09-05 14:28:47 -07:00
parent 32b477db15
commit c78a615dc0

View File

@@ -2540,11 +2540,11 @@ public class PhoneNumberUtils
}
// Split a phone number like "+20(123)-456#" using spaces, ignoring anything that is not
// a digit, to produce a result like "20 123 456".
// a digit or the characters * and #, to produce a result like "20 123 456#".
private static String splitAtNonNumerics(CharSequence number) {
StringBuilder sb = new StringBuilder(number.length());
for (int i = 0; i < number.length(); i++) {
sb.append(PhoneNumberUtils.isISODigit(number.charAt(i))
sb.append(PhoneNumberUtils.is12Key(number.charAt(i))
? number.charAt(i)
: " ");
}