static GsmMmiCode newFromUssdUserInput(
      String ussdMessge, GSMPhone phone, UiccCardApplication app) {
    GsmMmiCode ret = new GsmMmiCode(phone, app);

    ret.message = ussdMessge;
    ret.state = State.PENDING;
    ret.isPendingUSSD = true;

    return ret;
  }
  static GsmMmiCode newNetworkInitiatedUssd(
      String ussdMessage, boolean isUssdRequest, GSMPhone phone, UiccCardApplication app) {
    GsmMmiCode ret;

    ret = new GsmMmiCode(phone, app);

    ret.message = ussdMessage;
    ret.isUssdRequest = isUssdRequest;

    // If it's a request, set to PENDING so that it's cancelable.
    if (isUssdRequest) {
      ret.isPendingUSSD = true;
      ret.state = State.PENDING;
    } else {
      ret.state = State.COMPLETE;
    }

    return ret;
  }