diff options
author | John Wang <johnwang@google.com> | 2011-12-07 16:38:56 -0800 |
---|---|---|
committer | John Wang <johnwang@google.com> | 2011-12-07 16:38:56 -0800 |
commit | 269081781573ac6f830c00b24efe3cf8af80bd32 (patch) | |
tree | a70f4ab96cc96699532606f1295fb3114289fbd5 /telephony | |
parent | 9a856f4ee7b49f735e31b57a09bee2f033ce20a5 (diff) | |
download | frameworks_base-269081781573ac6f830c00b24efe3cf8af80bd32.zip frameworks_base-269081781573ac6f830c00b24efe3cf8af80bd32.tar.gz frameworks_base-269081781573ac6f830c00b24efe3cf8af80bd32.tar.bz2 |
Correct the dialing number of structured MMI.
According to TS 22.030 6.5.2 "Structure of the MMI", the dialing number
can not end with #. The format is like *SC*SI#DN. Correct the mmi pattern
to exclude DN# case. With this fix, processCode() will tread *NNN#DN#,
e.g. *400#16 digit number# in bug 5622718, as USSD and send via
RIL_REQUEST_SEND_USSD.
bug:5622718
Change-Id: Ifc8d0edff4308602a5f3fc651cf116bf6bad3cbc
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java index 3799894..16d3129 100644 --- a/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java +++ b/telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java @@ -132,7 +132,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 # @@ -141,7 +141,7 @@ public final class GsmMmiCode extends Handler implements MmiCode { 5 = SIA 7 = SIB 9 = SIC - 10 = dialing number + 10 = dialing number which must not include #, e.g. *SCn*SI#DN format */ static final int MATCH_GROUP_POUND_STRING = 1; @@ -1338,4 +1338,20 @@ public final class GsmMmiCode extends Handler implements MmiCode { * SpecialCharSequenceMgr class. */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder("GsmMmiCode {"); + + sb.append("State=" + getState()); + if (action != null) sb.append(" action=" + action); + if (sc != null) sb.append(" sc=" + sc); + if (sia != null) sb.append(" sia=" + sia); + if (sib != null) sb.append(" sib=" + sib); + if (sic != null) sb.append(" sic=" + sic); + if (poundString != null) sb.append(" poundString=" + poundString); + if (dialingNumber != null) sb.append(" dialingNumber=" + dialingNumber); + if (pwd != null) sb.append(" pwd=" + pwd); + sb.append("}"); + return sb.toString(); + } } |