diff options
author | Wei Huang <weih@google.com> | 2009-09-20 16:53:40 -0700 |
---|---|---|
committer | Wei Huang <weih@google.com> | 2009-09-20 21:13:45 -0700 |
commit | 02b5948a4375dba5d287a59ba023eaf1e02b45dc (patch) | |
tree | b113adaa03540c2015299f006d5104cd82fcc3b4 /telephony | |
parent | 25a13907aa8e4478e29237641f8a47b862ff7e92 (diff) | |
download | frameworks_base-02b5948a4375dba5d287a59ba023eaf1e02b45dc.zip frameworks_base-02b5948a4375dba5d287a59ba023eaf1e02b45dc.tar.gz frameworks_base-02b5948a4375dba5d287a59ba023eaf1e02b45dc.tar.bz2 |
make PhoneNumberUtils.compareLoosely use MIN_MATCH of 7 instead of 5.
Change-Id: Id4a08c3834b727e253ab189293d5715ffbbe8f35
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/PhoneNumberUtils.java | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index 2d8afb7..046bfea 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -317,7 +317,7 @@ public class PhoneNumberUtils * enough for caller ID purposes. * * - Compares from right to left - * - requires MIN_MATCH (5) characters to match + * - requires MIN_MATCH (7) characters to match * - handles common trunk prefixes and international prefixes * (basically, everything except the Russian trunk prefix) * @@ -1202,10 +1202,24 @@ public class PhoneNumberUtils JapanesePhoneNumberFormatter.format(text); } - // Three and four digit phone numbers for either special services - // or from the network (eg carrier-originated SMS messages) should - // not match - static final int MIN_MATCH = 5; + // Three and four digit phone numbers for either special services, + // or 3-6 digit addresses from the network (eg carrier-originated SMS messages) should + // not match. + // + // This constant used to be 5, but SMS short codes has increased in length and + // can be easily 6 digits now days. Most countries have SMS short code length between + // 3 to 6 digits. The exceptions are + // + // Australia: Short codes are six or eight digits in length, starting with the prefix "19" + // followed by an additional four or six digits and two. + // Czech Republic: Codes are seven digits in length for MO and five (not billed) or + // eight (billed) for MT direction + // + // see http://en.wikipedia.org/wiki/Short_code#Regional_differences for reference + // + // However, in order to loose match 650-555-1212 and 555-1212, we need to set the min match + // to 7. + static final int MIN_MATCH = 7; /** * isEmergencyNumber: checks a given number against the list of |