diff options
author | Daisuke Miyakawa <dmiyakawa@google.com> | 2012-02-14 19:11:13 -0800 |
---|---|---|
committer | Daisuke Miyakawa <dmiyakawa@google.com> | 2012-02-15 11:29:21 -0800 |
commit | 510db8feb611a924d235b9b8a1d55ebbd36e9022 (patch) | |
tree | 25b0220c715465d55af78aa1ec49392edc7a3299 /telephony/java/android | |
parent | 91ec0b722f659bb5e4bcc64339f2fbbe30a31287 (diff) | |
download | frameworks_base-510db8feb611a924d235b9b8a1d55ebbd36e9022.zip frameworks_base-510db8feb611a924d235b9b8a1d55ebbd36e9022.tar.gz frameworks_base-510db8feb611a924d235b9b8a1d55ebbd36e9022.tar.bz2 |
Introduce convertAndStrip()
Phone app will use this for actual phone calling, coping with
IccProvider, etc.
Add unit tests for the method, and stripSeparators() which is missing
Bug: 5546664
Change-Id: I49b996abe7a44f7db4301b62f667189281fc40e9
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/PhoneNumberUtils.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 24a4876..8cfdb79 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -292,6 +292,20 @@ public class PhoneNumberUtils } /** + * Translates keypad letters to actual digits (e.g. 1-800-GOOG-411 will + * become 1-800-4664-411), and then strips all separators (e.g. 1-800-4664-411 will become + * 18004664411). + * + * @see #convertKeypadLettersToDigits(String) + * @see #stripSeparators(String) + * + * @hide + */ + public static String convertAndStrip(String phoneNumber) { + return stripSeparators(convertKeypadLettersToDigits(phoneNumber)); + } + + /** * Converts pause and tonewait pause characters * to Android representation. * RFC 3601 says pause is 'p' and tonewait is 'w'. |