Esempio n. 1
0
  /** Check if provided string contains Mmi code in it and create corresponding Mmi if it does */
  public static CdmaMmiCode newFromDialString(String dialString, CDMAPhone phone) {
    Matcher m;
    CdmaMmiCode ret = null;

    m = sPatternSuppService.matcher(dialString);

    // Is this formatted like a standard supplementary service code?
    if (m.matches()) {
      ret = new CdmaMmiCode(phone);
      ret.poundString = makeEmptyNull(m.group(MATCH_GROUP_POUND_STRING));
      ret.action = makeEmptyNull(m.group(MATCH_GROUP_ACTION));
      ret.sc = makeEmptyNull(m.group(MATCH_GROUP_SERVICE_CODE));
      ret.sia = makeEmptyNull(m.group(MATCH_GROUP_SIA));
      ret.sib = makeEmptyNull(m.group(MATCH_GROUP_SIB));
      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));
    }

    return ret;
  }