diff options
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | api/test-current.txt | 1 | ||||
| -rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 27 |
4 files changed, 11 insertions, 19 deletions
diff --git a/api/current.txt b/api/current.txt index 35e45e871402..b20fe8fe07f5 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38181,7 +38181,6 @@ package android.telephony { method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler); - method public void sendUssdRequest(java.lang.String, int, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler); method public void setDataEnabled(boolean); method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String); diff --git a/api/system-current.txt b/api/system-current.txt index 9f6305ed0211..6ee54cae8e02 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -41405,7 +41405,6 @@ package android.telephony { method public boolean needsOtaServiceProvisioning(); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler); - method public void sendUssdRequest(java.lang.String, int, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler); method public int setAllowedCarriers(int, java.util.List<android.service.carrier.CarrierIdentifier>); method public void setDataEnabled(boolean); method public void setDataEnabled(int, boolean); diff --git a/api/test-current.txt b/api/test-current.txt index ad6f000d1195..1c4db6cab1df 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -38280,7 +38280,6 @@ package android.telephony { method public void listen(android.telephony.PhoneStateListener, int); method public java.lang.String sendEnvelopeWithStatus(java.lang.String); method public void sendUssdRequest(java.lang.String, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler); - method public void sendUssdRequest(java.lang.String, int, android.telephony.TelephonyManager.OnReceiveUssdResponseCallback, android.os.Handler); method public void setDataEnabled(boolean); method public boolean setLine1NumberForDisplay(java.lang.String, java.lang.String); method public boolean setOperatorBrandOverride(java.lang.String); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 36c2eabac225..70005f1c54cd 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5070,26 +5070,21 @@ public class TelephonyManager { public void onReceiveUssdResponseFailed(String request, int failureCode) {}; } - /* <p>Requires permission: - * @link android.Manifest.permission#CALL_PHONE} + /** + * Sends an Unstructured Supplementary Service Data (USSD) request to the cellular network and + * informs the caller of the response via {@code callback}. + * <p>Carriers define USSD codes which can be sent by the user to request information such as + * the user's current data balance or minutes balance. + * <p>Requires permission: + * {@link android.Manifest.permission#CALL_PHONE} * @param ussdRequest the USSD command to be executed. - * @param wrappedCallback receives a callback result. + * @param callback called by the framework to inform the caller of the result of executing the + * USSD request (see {@link OnReceiveUssdResponseCallback}). + * @param handler the {@link Handler} to run the request on. */ @RequiresPermission(android.Manifest.permission.CALL_PHONE) public void sendUssdRequest(String ussdRequest, final OnReceiveUssdResponseCallback callback, Handler handler) { - sendUssdRequest(ussdRequest, getSubId(), callback, handler); - } - - /* <p>Requires permission: - * @link android.Manifest.permission#CALL_PHONE} - * @param subId The subscription to use. - * @param ussdRequest the USSD command to be executed. - * @param wrappedCallback receives a callback result. - */ - @RequiresPermission(android.Manifest.permission.CALL_PHONE) - public void sendUssdRequest(String ussdRequest, int subId, - final OnReceiveUssdResponseCallback callback, Handler handler) { checkNotNull(callback, "OnReceiveUssdResponseCallback cannot be null."); ResultReceiver wrappedCallback = new ResultReceiver(handler) { @@ -5111,7 +5106,7 @@ public class TelephonyManager { try { ITelephony telephony = getITelephony(); if (telephony != null) { - telephony.handleUssdRequest(subId, ussdRequest, wrappedCallback); + telephony.handleUssdRequest(mSubId, ussdRequest, wrappedCallback); } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#sendUSSDCode", e); |