Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4cb183f authored by Glenn Maynard's avatar Glenn Maynard Committed by Steve Kondik
Browse files

Work around some functional but nonstandard MMI codes.

http://code.google.com/p/android/issues/detail?id=2226
http://code.google.com/p/cyanogenmod/issues/detail?id=1575

The MMI code "#190*1660#*" is nonstandard, not ending with #.  The "*"
at the end gets parsed as the dialingNumber portion, and processCode
raises an error instead of treating it as a generic MMI code with no
special handling and passing it on verbatim.

Treat the * at the end as part of the # terminator, so it doesn't get
dropped into dialingNumber.

I can't fully test this; I don't know any T-Mobile MMI codes like this
and I'm not going to dial mysterious MMI codes into my phone.  I've tested
that normal MMI codes still work by stopping and restarting call
forwarding to GV on my phone.  Someone affected by this issue needs to
test this.

Updated the "dialing number" comment, which was incorrect.

If this isn't fixed in the 2.2 source drop, this commit can probably be
pushed upstream after confirmation.
parent 1918bb88
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -124,8 +124,12 @@ public final class GsmMmiCode extends Handler implements MmiCode {


    // See TS 22.030 6.5.2 "Structure of the MMI"
    // See TS 22.030 6.5.2 "Structure of the MMI"


    // Note that some nonstandard MMI codes seem to end with an asterisk, eg. "#190*1660#*"
    // (http://code.google.com/p/android/issues/detail?id=2226).  Make sure this doesn't get
    // merged into MATCH_GROUP_DIALING_NUMBER.

    static Pattern sPatternSuppService = Pattern.compile(
    static Pattern sPatternSuppService = Pattern.compile(
        "((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#)(.*)");
        "((\\*|#|\\*#|\\*\\*|##)(\\d{2,3})(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*)(\\*([^*#]*))?)?)?)?#\\*?)(.*)");
/*       1  2                    3          4  5       6   7         8    9     10  11             12
/*       1  2                    3          4  5       6   7         8    9     10  11             12


         1 = Full string up to and including #
         1 = Full string up to and including #
@@ -134,7 +138,7 @@ public final class GsmMmiCode extends Handler implements MmiCode {
         5 = SIA
         5 = SIA
         7 = SIB
         7 = SIB
         9 = SIC
         9 = SIC
         10 = dialing number
         12 = dialing number
*/
*/


    static final int MATCH_GROUP_POUND_STRING = 1;
    static final int MATCH_GROUP_POUND_STRING = 1;