summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-02-02 16:03:29 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-02 16:03:29 -0800
commitaec39e625b95088f4020302a0eac1f38da43c765 (patch)
treef3feb2be86c64a9d28981b67f6fdb92aff9dbc6a /telephony
parent421d94c20321e1de528416b279bf148baba47b39 (diff)
parentd6d2de6b3c22f34aed80e36d58ae5c9692bb2933 (diff)
downloadframeworks_base-aec39e625b95088f4020302a0eac1f38da43c765.zip
frameworks_base-aec39e625b95088f4020302a0eac1f38da43c765.tar.gz
frameworks_base-aec39e625b95088f4020302a0eac1f38da43c765.tar.bz2
Merge "resolved conflicts for merge of ec348b49 to honeycomb-plus-aosp" into honeycomb-plus-aosp
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java27
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