Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c78a615d authored by Tyler Gunn's avatar Tyler Gunn
Browse files

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
parent 32b477db
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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)
                    : " ");
        }