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

Commit c75ff8e4 authored by Yorke Lee's avatar Yorke Lee
Browse files

Allow vanity numbers via paste/DIAL intent

Converts vanity numbers such as 1-800-FLOWERS to the numeric
equivalents when the number string is populated via a DIAL intent
or pasted from the clipboard. Does not remove valid formatting such
as dashes, periods, spaces, etc.

Bug: 7553166
Change-Id: I553c91628b8fd86ff38a8eeec7823ebdc96bfe6b
parent c5cf5396
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -347,7 +347,9 @@ public class DialpadFragment extends Fragment
                    String data = uri.getSchemeSpecificPart();
                    // Remember it is filled via Intent.
                    mDigitsFilledByIntent = true;
                    setFormattedDigits(data, null);
                    final String converted = PhoneNumberUtils.convertKeypadLettersToDigits(
                            PhoneNumberUtils.replaceUnicodeDigits(data));
                    setFormattedDigits(converted, null);
                    return true;
                } else {
                    String type = intent.getType();
+2 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@ public class UnicodeDialerKeyListener extends DialerKeyListener {
    @Override
    public CharSequence filter(CharSequence source, int start, int end,
            Spanned dest, int dstart, int dend) {
        CharSequence converted = PhoneNumberUtils.replaceUnicodeDigits(source.toString());
        final String converted = PhoneNumberUtils.convertKeypadLettersToDigits(
                PhoneNumberUtils.replaceUnicodeDigits(source.toString()));
        // PhoneNumberUtils.replaceUnicodeDigits performs a character for character replacement,
        // so we can assume that start and end positions should remain unchanged.
        CharSequence result = super.filter(converted, start, end, dest, dstart, dend);