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

Commit 0aa03d22 authored by Anju Mathapati's avatar Anju Mathapati Committed by Pavel Zhamaitsiak
Browse files

ussd: Suppress error dialog when ussd release received

Remove the prompt sent when network releases USSD session

Bug: 17782840
Change-Id: I4ca1d6db3be89ce2f28986cbc96824276edc6c7f
parent 657d4db8
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -96,6 +96,10 @@ public interface CommandsInterface {
    // by messages sent to setOnUSSD handler
    static final int USSD_MODE_NOTIFY        = 0;
    static final int USSD_MODE_REQUEST       = 1;
    static final int USSD_MODE_NW_RELEASE    = 2;
    static final int USSD_MODE_LOCAL_CLIENT  = 3;
    static final int USSD_MODE_NOT_SUPPORTED = 4;
    static final int USSD_MODE_NW_TIMEOUT    = 5;

    // GSM SMS fail cause for acknowledgeLastIncomingSMS. From TS 23.040, 9.2.3.22.
    static final int GSM_SMS_FAIL_CAUSE_MEMORY_CAPACITY_EXCEEDED    = 0xD3;
+6 −1
Original line number Diff line number Diff line
@@ -1322,6 +1322,7 @@ public class GSMPhone extends PhoneBase {
    onIncomingUSSD (int ussdMode, String ussdMessage) {
        boolean isUssdError;
        boolean isUssdRequest;
        boolean isUssdRelease;

        isUssdRequest
            = (ussdMode == CommandsInterface.USSD_MODE_REQUEST);
@@ -1330,6 +1331,8 @@ public class GSMPhone extends PhoneBase {
            = (ussdMode != CommandsInterface.USSD_MODE_NOTIFY
                && ussdMode != CommandsInterface.USSD_MODE_REQUEST);

        isUssdRelease = (ussdMode == CommandsInterface.USSD_MODE_NW_RELEASE);

        // See comments in GsmMmiCode.java
        // USSD requests aren't finished until one
        // of these two events happen
@@ -1344,7 +1347,9 @@ public class GSMPhone extends PhoneBase {
        if (found != null) {
            // Complete pending USSD

            if (isUssdError) {
            if (isUssdRelease) {
                found.onUssdRelease();
            } else if (isUssdError) {
                found.onUssdFinishedError();
            } else {
                found.onUssdFinished(ussdMessage, isUssdRequest);
+19 −0
Original line number Diff line number Diff line
@@ -898,6 +898,25 @@ public final class GsmMmiCode extends Handler implements MmiCode {
        }
    }

    /**
     * Called from GSMPhone
     *
     * An unsolicited USSD NOTIFY or REQUEST has come in matching
     * up with this pending USSD request
     *
     * Note: If REQUEST, this exchange is complete, but the session remains
     *       active (ie, the network expects user input).
     */
    void
    onUssdRelease() {
        if (mState == State.PENDING) {
            mState = State.COMPLETE;
            mMessage = null;

            mPhone.onMMIDone(this);
        }
    }

    void sendUssd(String ussdMessage) {
        // Treat this as a USSD string
        mIsPendingUSSD = true;