From 3ffa1ff87471c3e631e7386ac250b6d45c4b00b8 Mon Sep 17 00:00:00 2001 From: pkanwar Date: Mon, 20 Mar 2017 12:23:42 -0700 Subject: [PATCH] Updated javadocs for sendUssd APIs. Bug: 35766546 Change-Id: I40f0addc15331184b3409b3d1b5c9dc1455d8b5b Merged-in: I40f0addc15331184b3409b3d1b5c9dc1455d8b5b Test: manual --- api/current.txt | 1 - api/system-current.txt | 1 - api/test-current.txt | 1 - .../android/telephony/TelephonyManager.java | 27 ++++++++----------- 4 files changed, 11 insertions(+), 19 deletions(-) diff --git a/api/current.txt b/api/current.txt index f51b81cabc54b..c46c583f58e62 100644 --- a/api/current.txt +++ b/api/current.txt @@ -38179,7 +38179,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 193706c714ee6..25239d77a6400 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -41403,7 +41403,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); method public void setDataEnabled(boolean); method public void setDataEnabled(int, boolean); diff --git a/api/test-current.txt b/api/test-current.txt index c4737f78a2d6a..2564294708900 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -38278,7 +38278,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 acdfa051811ce..a26023e327228 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -5057,26 +5057,21 @@ public class TelephonyManager { public void onReceiveUssdResponseFailed(String request, int failureCode) {}; } - /*

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}. + *

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. + *

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); - } - - /*

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) { @@ -5098,7 +5093,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);