diff options
author | John Wang <johnwang@google.com> | 2012-09-24 17:01:58 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-09-24 17:01:59 -0700 |
commit | f4bfdd2941bdee6927a5300556a5c1d490bbff33 (patch) | |
tree | 179dedc9fffd031bbcfb7bedd43f708879456e88 /src | |
parent | 1b5c213b68a9d7ab4af0263161ba9eb91668dedf (diff) | |
parent | 9225578f29e449d30380fcf71defb1ac7e8a59db (diff) | |
download | frameworks_opt_telephony-f4bfdd2941bdee6927a5300556a5c1d490bbff33.zip frameworks_opt_telephony-f4bfdd2941bdee6927a5300556a5c1d490bbff33.tar.gz frameworks_opt_telephony-f4bfdd2941bdee6927a5300556a5c1d490bbff33.tar.bz2 |
Merge "Handle mmi dialing number ending with #." into jb-mr1-dev
Diffstat (limited to 'src')
-rw-r--r-- | src/java/com/android/internal/telephony/gsm/GsmMmiCode.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java index fdc0606..10efdc4 100644 --- a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java +++ b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java @@ -135,7 +135,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { // See TS 22.030 6.5.2 "Structure of the MMI" static Pattern sPatternSuppService = Pattern.compile( - "((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#)([^#]*)"); + "((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#)(.*)"); /* 1 2 3 4 5 6 7 8 9 10 11 12 1 = Full string up to and including # @@ -144,7 +144,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { 5 = SIA 7 = SIB 9 = SIC - 10 = dialing number which must not include #, e.g. *SCn*SI#DN format + 10 = dialing number */ static final int MATCH_GROUP_POUND_STRING = 1; @@ -193,7 +193,17 @@ public final class GsmMmiCode extends Handler implements MmiCode { ret.sic = makeEmptyNull(m.group(MATCH_GROUP_SIC)); ret.pwd = makeEmptyNull(m.group(MATCH_GROUP_PWD_CONFIRM)); ret.dialingNumber = makeEmptyNull(m.group(MATCH_GROUP_DIALING_NUMBER)); - + // According to TS 22.030 6.5.2 "Structure of the MMI", + // the dialing number should not ending with #. + // The dialing number ending # is treated as unique USSD, + // eg, *400#16 digit number# to recharge the prepaid card + // in India operator(Mumbai MTNL) + if(ret.dialingNumber != null && + ret.dialingNumber.endsWith("#") && + dialString.endsWith("#")){ + ret = new GsmMmiCode(phone, app); + ret.poundString = dialString; + } } else if (dialString.endsWith("#")) { // TS 22.030 sec 6.5.3.2 // "Entry of any characters defined in the 3GPP TS 23.038 [8] Default Alphabet |