diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-02-02 14:23:10 -0800 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2011-02-02 14:23:10 -0800 |
commit | ec348b495367d799d9985060f7f070128f142f5f (patch) | |
tree | 61d5ab60b689f7703443df754e8b13569a47b5c0 /telephony | |
parent | f6b2beaabda6607b1c60dccaff038e9b59733821 (diff) | |
parent | 0a4b3fd93b2de21de0684a8291663920d9099170 (diff) | |
download | frameworks_base-ec348b495367d799d9985060f7f070128f142f5f.zip frameworks_base-ec348b495367d799d9985060f7f070128f142f5f.tar.gz frameworks_base-ec348b495367d799d9985060f7f070128f142f5f.tar.bz2 |
resolved conflicts for merge of 0a4b3fd9 to gingerbread-plus-aosp
Change-Id: I294e6e843ae028377d19c1180e0d5e9aef52897c
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java index fe7a5cb..2962e0f 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java @@ -155,7 +155,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { static final int MATCH_GROUP_SIC = 9; static final int MATCH_GROUP_PWD_CONFIRM = 11; static final int MATCH_GROUP_DIALING_NUMBER = 12; - + static private String[] sTwoDigitNumberPattern; //***** Public Class methods @@ -198,6 +198,9 @@ public final class GsmMmiCode extends Handler implements MmiCode { ret = new GsmMmiCode(phone); ret.poundString = dialString; + } else if (isTwoDigitShortCode(phone.getContext(), dialString)) { + //Is a country-specific exception to short codes as defined in TS 22.030, 6.5.3.2 + ret = null; } else if (isShortCode(dialString, phone)) { // this may be a short code, as defined in TS 22.030, 6.5.3.2 ret = new GsmMmiCode(phone); @@ -452,6 +455,28 @@ public final class GsmMmiCode extends Handler implements MmiCode { } + static private boolean + isTwoDigitShortCode(Context context, String dialString) { + Log.d(LOG_TAG, "isTwoDigitShortCode"); + + if (dialString == null || dialString.length() != 2) return false; + + if (sTwoDigitNumberPattern == null) { + sTwoDigitNumberPattern = context.getResources().getStringArray( + com.android.internal.R.array.config_twoDigitNumberPattern); + } + + for (String dialnumber : sTwoDigitNumberPattern) { + Log.d(LOG_TAG, "Two Digit Number Pattern " + dialnumber); + if (dialString.equals(dialnumber)) { + Log.d(LOG_TAG, "Two Digit Number Pattern -true"); + return true; + } + } + Log.d(LOG_TAG, "Two Digit Number Pattern -false"); + return false; + } + /** * Helper function for newFromDialString. Returns true if dialString appears * to be a short code AND conditions are correct for it to be treated as |