Skip to content

Commit 2690817

Browse files
author
John Wang
committed
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
1 parent 9a856f4 commit 2690817

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

telephony/java/com/android/internal/telephony/gsm/GsmMmiCode.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public final class GsmMmiCode extends Handler implements MmiCode {
132132
// See TS 22.030 6.5.2 "Structure of the MMI"
133133

134134
static Pattern sPatternSuppService = Pattern.compile(
135-
"((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#)(.*)");
135+
"((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#)([^#]*)");
136136
/* 1 2 3 4 5 6 7 8 9 10 11 12
137137
138138
1 = Full string up to and including #
@@ -141,7 +141,7 @@ public final class GsmMmiCode extends Handler implements MmiCode {
141141
5 = SIA
142142
7 = SIB
143143
9 = SIC
144-
10 = dialing number
144+
10 = dialing number which must not include #, e.g. *SCn*SI#DN format
145145
*/
146146

147147
static final int MATCH_GROUP_POUND_STRING = 1;
@@ -1338,4 +1338,20 @@ private CharSequence getScString() {
13381338
* SpecialCharSequenceMgr class.
13391339
*/
13401340

1341+
@Override
1342+
public String toString() {
1343+
StringBuilder sb = new StringBuilder("GsmMmiCode {");
1344+
1345+
sb.append("State=" + getState());
1346+
if (action != null) sb.append(" action=" + action);
1347+
if (sc != null) sb.append(" sc=" + sc);
1348+
if (sia != null) sb.append(" sia=" + sia);
1349+
if (sib != null) sb.append(" sib=" + sib);
1350+
if (sic != null) sb.append(" sic=" + sic);
1351+
if (poundString != null) sb.append(" poundString=" + poundString);
1352+
if (dialingNumber != null) sb.append(" dialingNumber=" + dialingNumber);
1353+
if (pwd != null) sb.append(" pwd=" + pwd);
1354+
sb.append("}");
1355+
return sb.toString();
1356+
}
13411357
}

0 commit comments

Comments
 (0)