From 0aa03d22e29d57d1064c292bcdb4e762e9abca01 Mon Sep 17 00:00:00 2001 From: Anju Mathapati Date: Tue, 21 Oct 2014 09:55:41 -0700 Subject: ussd: Suppress error dialog when ussd release received Remove the prompt sent when network releases USSD session Bug: 17782840 Change-Id: I4ca1d6db3be89ce2f28986cbc96824276edc6c7f --- .../android/internal/telephony/CommandsInterface.java | 8 ++++++-- .../com/android/internal/telephony/gsm/GSMPhone.java | 7 ++++++- .../android/internal/telephony/gsm/GsmMmiCode.java | 19 +++++++++++++++++++ 3 files changed, 31 insertions(+), 3 deletions(-) (limited to 'src/java') diff --git a/src/java/com/android/internal/telephony/CommandsInterface.java b/src/java/com/android/internal/telephony/CommandsInterface.java index 07662aa91..a2cbf9651 100644 --- a/src/java/com/android/internal/telephony/CommandsInterface.java +++ b/src/java/com/android/internal/telephony/CommandsInterface.java @@ -94,8 +94,12 @@ public interface CommandsInterface { // Numeric representation of string values returned // 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_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; diff --git a/src/java/com/android/internal/telephony/gsm/GSMPhone.java b/src/java/com/android/internal/telephony/gsm/GSMPhone.java index f96fdc298..272dfc8f3 100644 --- a/src/java/com/android/internal/telephony/gsm/GSMPhone.java +++ b/src/java/com/android/internal/telephony/gsm/GSMPhone.java @@ -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); diff --git a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java index 90e783e13..0e7885a15 100644 --- a/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java +++ b/src/java/com/android/internal/telephony/gsm/GsmMmiCode.java @@ -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; -- cgit v1.2.3