From c78a615dc083f24d810b1cbcad6438005d07036a Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 5 Sep 2017 14:28:47 -0700 Subject: [PATCH] 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 --- telephony/java/android/telephony/PhoneNumberUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 87054469c2f9b..d5ff1adb607da 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -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) : " "); }