summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2012-11-19 15:25:51 -0800
committerYorke Lee <yorkelee@google.com>2013-05-07 17:28:28 -0700
commitf744f53ed980ba901b458b070a1b5eb4526b69f3 (patch)
tree0f53e0ba22154f863eaead457533cd61ac2a4f5e
parent006d071bd477768b4685385d15b3385f6d2e834d (diff)
Allow vanity numbers via paste/DIAL intent
https://googleplex-android-review.googlesource.com/#/c/253417/ 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: 8858358 Change-Id: I553c91628b8fd86ff38a8eeec7823ebdc96bfe6b
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java4
-rw-r--r--src/com/android/dialer/dialpad/UnicodeDialerKeyListener.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 3693e6aa0..20148b705 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -395,7 +395,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();
diff --git a/src/com/android/dialer/dialpad/UnicodeDialerKeyListener.java b/src/com/android/dialer/dialpad/UnicodeDialerKeyListener.java
index c25c7a9dd..740b4566f 100644
--- a/src/com/android/dialer/dialpad/UnicodeDialerKeyListener.java
+++ b/src/com/android/dialer/dialpad/UnicodeDialerKeyListener.java
@@ -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);