diff options
17 files changed, 285 insertions, 41 deletions
diff --git a/api/current.txt b/api/current.txt index 1acee629fdb5..8baca126033a 100644 --- a/api/current.txt +++ b/api/current.txt @@ -40317,7 +40317,6 @@ package android.telephony { field public static final int SIM_STATE_UNKNOWN = 0; // 0x0 field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe field public static final int USSD_RETURN_FAILURE = -1; // 0xffffffff - field public static final int USSD_RETURN_SUCCESS = 100; // 0x64 field public static final java.lang.String VVM_TYPE_CVVM = "vvm_type_cvvm"; field public static final java.lang.String VVM_TYPE_OMTP = "vvm_type_omtp"; } diff --git a/api/system-current.txt b/api/system-current.txt index c31c3d9ab4ee..5945abc802a0 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -43861,7 +43861,6 @@ package android.telephony { field public static final int SIM_STATE_UNKNOWN = 0; // 0x0 field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe field public static final int USSD_RETURN_FAILURE = -1; // 0xffffffff - field public static final int USSD_RETURN_SUCCESS = 100; // 0x64 field public static final java.lang.String VVM_TYPE_CVVM = "vvm_type_cvvm"; field public static final java.lang.String VVM_TYPE_OMTP = "vvm_type_omtp"; } diff --git a/api/test-current.txt b/api/test-current.txt index 22c09ac057d0..eac5b8028f99 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -40512,7 +40512,6 @@ package android.telephony { field public static final int SIM_STATE_UNKNOWN = 0; // 0x0 field public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; // 0xfffffffe field public static final int USSD_RETURN_FAILURE = -1; // 0xffffffff - field public static final int USSD_RETURN_SUCCESS = 100; // 0x64 field public static final java.lang.String VVM_TYPE_CVVM = "vvm_type_cvvm"; field public static final java.lang.String VVM_TYPE_OMTP = "vvm_type_omtp"; } diff --git a/core/java/android/bluetooth/le/BluetoothLeScanner.java b/core/java/android/bluetooth/le/BluetoothLeScanner.java index 8d2c3ec92c0c..52465137dfd6 100644 --- a/core/java/android/bluetooth/le/BluetoothLeScanner.java +++ b/core/java/android/bluetooth/le/BluetoothLeScanner.java @@ -73,7 +73,7 @@ public final class BluetoothLeScanner { /** * Optional extra indicating the callback type, which will be one of - * ScanSettings.CALLBACK_TYPE_*. + * CALLBACK_TYPE_* constants in {@link ScanSettings}. * @see ScanCallback#onScanResult(int, ScanResult) */ public static final String EXTRA_CALLBACK_TYPE = "android.bluetooth.le.extra.CALLBACK_TYPE"; diff --git a/core/java/android/transition/ChangeClipBounds.java b/core/java/android/transition/ChangeClipBounds.java index 8d0943c50430..a6398d3faeb7 100644 --- a/core/java/android/transition/ChangeClipBounds.java +++ b/core/java/android/transition/ChangeClipBounds.java @@ -16,6 +16,7 @@ package android.transition; import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; import android.animation.ObjectAnimator; import android.animation.RectEvaluator; import android.content.Context; @@ -84,6 +85,7 @@ public class ChangeClipBounds extends Transition { } Rect start = (Rect) startValues.values.get(PROPNAME_CLIP); Rect end = (Rect) endValues.values.get(PROPNAME_CLIP); + boolean endIsNull = end == null; if (start == null && end == null) { return null; // No animation required since there is no clip. } @@ -99,6 +101,17 @@ public class ChangeClipBounds extends Transition { endValues.view.setClipBounds(start); RectEvaluator evaluator = new RectEvaluator(new Rect()); - return ObjectAnimator.ofObject(endValues.view, "clipBounds", evaluator, start, end); + ObjectAnimator animator = + ObjectAnimator.ofObject(endValues.view, "clipBounds", evaluator, start, end); + if (endIsNull) { + final View endView = endValues.view; + animator.addListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + endView.setClipBounds(null); + } + }); + } + return animator; } } diff --git a/packages/CompanionDeviceManager/res/layout/buttons.xml b/packages/CompanionDeviceManager/res/layout/buttons.xml index 350a791ac30e..7de0035d0cc9 100644 --- a/packages/CompanionDeviceManager/res/layout/buttons.xml +++ b/packages/CompanionDeviceManager/res/layout/buttons.xml @@ -29,14 +29,14 @@ android:id="@+id/button_cancel" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/cancel" + android:text="@android:string/cancel" style="@android:style/Widget.Material.Light.Button.Borderless.Colored" /> <Button android:id="@+id/button_pair" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/pair" + android:text="@android:string/ok" style="@android:style/Widget.Material.Light.Button.Borderless.Colored" /> </LinearLayout>
\ No newline at end of file diff --git a/packages/CompanionDeviceManager/res/values/strings.xml b/packages/CompanionDeviceManager/res/values/strings.xml index 469c1fbf22ad..43a92b6020dd 100644 --- a/packages/CompanionDeviceManager/res/values/strings.xml +++ b/packages/CompanionDeviceManager/res/values/strings.xml @@ -20,15 +20,9 @@ <string name="app_label">Companion Device Manager</string> <!-- Title of the device selection dialog. --> - <string name="chooser_title">Pair with <strong><xliff:g id="app_name" example="Android Wear">%1$s</xliff:g></strong> via Bluetooth?</string> + <string name="chooser_title">Link with <strong><xliff:g id="app_name" example="Android Wear">%1$s</xliff:g></strong> via Bluetooth?</string> <!-- Title of the device pairing confirmation dialog. --> - <string name="confirmation_title">Pair <strong><xliff:g id="app_name" example="Android Wear">%1$s</xliff:g></strong> with <strong><xliff:g id="device_name" example="ASUS ZenWatch 2">%2$s</xliff:g></strong> via Bluetooth?</string> - - <!-- Label on the pair button in a companion device chooser/confirmation dialog --> - <string name="pair">Pair</string> - - <!-- Label on the cancel button in a companion device chooser/confirmation dialog --> - <string name="cancel">Cancel</string> + <string name="confirmation_title">Link <strong><xliff:g id="app_name" example="Android Wear">%1$s</xliff:g></strong> with <strong><xliff:g id="device_name" example="ASUS ZenWatch 2">%2$s</xliff:g></strong> via Bluetooth?</string> </resources> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java index f3c7b8495a01..4dec6c742148 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationInfo.java @@ -329,12 +329,14 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G private void updateSecondaryText() { final boolean disabled = mSingleNotificationChannel != null && getSelectedImportance() == IMPORTANCE_NONE; + final boolean isDefaultChannel = mSingleNotificationChannel != null && + mSingleNotificationChannel.getId().equals(NotificationChannel.DEFAULT_CHANNEL_ID); if (disabled) { mChannelDisabledView.setVisibility(View.VISIBLE); mNumChannelsView.setVisibility(View.GONE); } else { mChannelDisabledView.setVisibility(View.GONE); - mNumChannelsView.setVisibility(View.VISIBLE); + mNumChannelsView.setVisibility(isDefaultChannel ? View.INVISIBLE : View.VISIBLE); } } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java index 66385a1dfb01..907928f12a1c 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/NotificationInfoTest.java @@ -314,16 +314,14 @@ public class NotificationInfoTest extends SysuiTestCase { } @Test - public void testBindNotification_NumChannelsTextUniqueWhenDefaultChannel() throws Exception { + public void testBindNotification_NumChannelsTextHiddenWhenDefaultChannel() throws Exception { mNotificationInfo.bindNotification(mMockPackageManager, mMockINotificationManager, TEST_PACKAGE_NAME, Arrays.asList(mDefaultNotificationChannel), mNotificationChannel.getImportance(), mSbn, null, null, null, null, null); final TextView numChannelsView = (TextView) mNotificationInfo.findViewById(R.id.num_channels_desc); - assertEquals(View.VISIBLE, numChannelsView.getVisibility()); - assertEquals(mContext.getString(R.string.notification_default_channel_desc), - numChannelsView.getText()); + assertEquals(View.INVISIBLE, numChannelsView.getVisibility()); } @Test diff --git a/proto/src/wifi.proto b/proto/src/wifi.proto index 7eefb7e667c3..debb1578451a 100644 --- a/proto/src/wifi.proto +++ b/proto/src/wifi.proto @@ -238,6 +238,9 @@ message WifiLog { // Histogram of the delta between scan result RSSI and RSSI polls repeated RssiPollCount rssi_poll_delta_count = 51; + + // List of events + repeated StaEvent sta_event_list = 52; } // Information that gets logged for every WiFi connection. @@ -460,3 +463,202 @@ message SoftApReturnCodeCount { // Result of attempt to start SoftAp optional SoftApStartResult start_result = 3; } + +message StaEvent { + message ConfigInfo { + // The set of key management protocols supported by this configuration. + optional uint32 allowed_key_management = 1 [default = 0]; + + // The set of security protocols supported by this configuration. + optional uint32 allowed_protocols = 2 [default = 0]; + + // The set of authentication protocols supported by this configuration. + optional uint32 allowed_auth_algorithms = 3 [default = 0]; + + // The set of pairwise ciphers for WPA supported by this configuration. + optional uint32 allowed_pairwise_ciphers = 4 [default = 0]; + + // The set of group ciphers supported by this configuration. + optional uint32 allowed_group_ciphers = 5; + + // Is this a 'hidden network' + optional bool hidden_ssid = 6; + + // Is this a Hotspot 2.0 / passpoint network + optional bool is_passpoint = 7; + + // Is this an 'ephemeral' network (Not in saved network list, recommended externally) + optional bool is_ephemeral = 8; + + // Has a successful connection ever been established using this WifiConfiguration + optional bool has_ever_connected = 9; + + // RSSI of the scan result candidate associated with this WifiConfiguration + optional int32 scan_rssi = 10 [default = -127]; + + // Frequency of the scan result candidate associated with this WifiConfiguration + optional int32 scan_freq = 11 [default = -1]; + } + + enum EventType { + // Default/Invalid event + TYPE_UNKNOWN = 0; + + // Supplicant Association Rejection event. Code contains the 802.11 + TYPE_ASSOCIATION_REJECTION_EVENT = 1; + + // Supplicant L2 event, + TYPE_AUTHENTICATION_FAILURE_EVENT = 2; + + // Supplicant L2 event + TYPE_NETWORK_CONNECTION_EVENT = 3; + + // Supplicant L2 event + TYPE_NETWORK_DISCONNECTION_EVENT = 4; + + // Supplicant L2 event + TYPE_SUPPLICANT_STATE_CHANGE_EVENT = 5; + + // Supplicant L2 event + TYPE_CMD_ASSOCIATED_BSSID = 6; + + // IP Manager successfully completed IP Provisioning + TYPE_CMD_IP_CONFIGURATION_SUCCESSFUL = 7; + + // IP Manager failed to complete IP Provisioning + TYPE_CMD_IP_CONFIGURATION_LOST = 8; + + // IP Manager lost reachability to network neighbors + TYPE_CMD_IP_REACHABILITY_LOST = 9; + + // Indicator that Supplicant is targeting a BSSID for roam/connection + TYPE_CMD_TARGET_BSSID = 10; + + // Wifi framework is initiating a connection attempt + TYPE_CMD_START_CONNECT = 11; + + // Wifi framework is initiating a roaming connection attempt + TYPE_CMD_START_ROAM = 12; + + // SystemAPI connect() command, Settings App + TYPE_CONNECT_NETWORK = 13; + + // Network Agent has validated the internet connection (Captive Portal Check success, or user + // validation) + TYPE_NETWORK_AGENT_VALID_NETWORK = 14; + + // Framework initiated disconnect. Sometimes generated to give an extra reason for a disconnect + // Should typically be followed by a NETWORK_DISCONNECTION_EVENT with a local_gen = true + TYPE_FRAMEWORK_DISCONNECT = 15; + } + + enum FrameworkDisconnectReason { + // default/none/unknown value + DISCONNECT_UNKNOWN = 0; + + // API DISCONNECT + DISCONNECT_API = 1; + + // Some framework internal reason (generic) + DISCONNECT_GENERIC = 2; + + // Network Agent network validation failed, user signaled network unwanted + DISCONNECT_UNWANTED = 3; + + // Roaming timed out + DISCONNECT_ROAM_WATCHDOG_TIMER = 4; + + // P2P service requested wifi disconnect + DISCONNECT_P2P_DISCONNECT_WIFI_REQUEST = 5; + + // SIM was removed while using a SIM config + DISCONNECT_RESET_SIM_NETWORKS = 6; + } + + // Authentication Failure reasons as reported through the API. + enum AuthFailureReason { + // Unknown default + AUTH_FAILURE_UNKNOWN = 0; + + // The reason code if there is no error during authentication. It could also imply that there no + // authentication in progress, + AUTH_FAILURE_NONE = 1; + + // The reason code if there was a timeout authenticating. + AUTH_FAILURE_TIMEOUT = 2; + + // The reason code if there was a wrong password while authenticating. + AUTH_FAILURE_WRONG_PSWD = 3; + + // The reason code if there was EAP failure while authenticating. + AUTH_FAILURE_EAP_FAILURE = 4; + } + + // What event was this + optional EventType type = 1; + + // 80211 death reason code, relevant to NETWORK_DISCONNECTION_EVENTs + optional int32 reason = 2 [default = -1]; + + // 80211 Association Status code, relevant to ASSOCIATION_REJECTION_EVENTs + optional int32 status = 3 [default = -1]; + + // Designates whether a NETWORK_DISCONNECT_EVENT was by the STA or AP + optional bool local_gen = 4 [default = false]; + + // Network information from the WifiConfiguration of a framework initiated connection attempt + optional ConfigInfo config_info = 5; + + // RSSI from the last rssi poll (Only valid for active connections) + optional int32 last_rssi = 6 [default = -127]; + + // Link speed from the last rssi poll (Only valid for active connections) + optional int32 last_link_speed = 7 [default = -1]; + + // Frequency from the last rssi poll (Only valid for active connections) + optional int32 last_freq = 8 [default = -1]; + + // Enum used to define bit positions in the supplicant_state_change_bitmask + // See {@code frameworks/base/wifi/java/android/net/wifi/SupplicantState.java} for documentation + enum SupplicantState { + STATE_DISCONNECTED = 0; + + STATE_INTERFACE_DISABLED = 1; + + STATE_INACTIVE = 2; + + STATE_SCANNING = 3; + + STATE_AUTHENTICATING = 4; + + STATE_ASSOCIATING = 5; + + STATE_ASSOCIATED = 6; + + STATE_FOUR_WAY_HANDSHAKE = 7; + + STATE_GROUP_HANDSHAKE = 8; + + STATE_COMPLETED = 9; + + STATE_DORMANT = 10; + + STATE_UNINITIALIZED = 11; + + STATE_INVALID = 12; + } + + // Bit mask of all supplicant state changes that occured since the last event + optional uint32 supplicant_state_changes_bitmask = 9 [default = 0]; + + // The number of milliseconds that have elapsed since the device booted + optional int64 start_time_millis = 10 [default = 0]; + + optional FrameworkDisconnectReason framework_disconnect_reason = 11 [default = DISCONNECT_UNKNOWN]; + + // Flag which indicates if an association rejection event occured due to a timeout + optional bool association_timed_out = 12 [default = false]; + + // Authentication failure reason, as reported by WifiManager (calculated from state & deauth code) + optional AuthFailureReason auth_failure_reason = 13 [default = AUTH_FAILURE_UNKNOWN]; +} diff --git a/rs/java/android/renderscript/ScriptIntrinsicBlur.java b/rs/java/android/renderscript/ScriptIntrinsicBlur.java index 7a702e877a2e..a36873e34d8c 100644 --- a/rs/java/android/renderscript/ScriptIntrinsicBlur.java +++ b/rs/java/android/renderscript/ScriptIntrinsicBlur.java @@ -59,6 +59,9 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * @param ain The input allocation */ public void setInput(Allocation ain) { + if (ain.getType().getY() == 0) { + throw new RSIllegalArgumentException("Input set to a 1D Allocation"); + } mInput = ain; setVar(1, ain); } @@ -85,6 +88,9 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * type. */ public void forEach(Allocation aout) { + if (aout.getType().getY() == 0) { + throw new RSIllegalArgumentException("Output is a 1D Allocation"); + } forEach(0, (Allocation) null, aout, null); } @@ -97,6 +103,9 @@ public final class ScriptIntrinsicBlur extends ScriptIntrinsic { * @param opt LaunchOptions for clipping */ public void forEach(Allocation aout, Script.LaunchOptions opt) { + if (aout.getType().getY() == 0) { + throw new RSIllegalArgumentException("Output is a 1D Allocation"); + } forEach(0, (Allocation) null, aout, null, opt); } diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index dd4d9065f126..4ce76f4b96fe 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -1531,6 +1531,9 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { intent.putExtra(PhoneConstants.SLOT_KEY, phoneId); } + // Wakeup apps for the (SUBSCRIPTION_)PHONE_STATE broadcast. + intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); + // Send broadcast twice, once for apps that have PRIVILEGED permission and once for those // that have the runtime one mContext.sendBroadcastAsUser(intent, UserHandle.ALL, diff --git a/services/core/java/com/android/server/am/ActivityMetricsLogger.java b/services/core/java/com/android/server/am/ActivityMetricsLogger.java index 494aaa766b94..08ff7de87c9f 100644 --- a/services/core/java/com/android/server/am/ActivityMetricsLogger.java +++ b/services/core/java/com/android/server/am/ActivityMetricsLogger.java @@ -254,8 +254,7 @@ class ActivityMetricsLogger { * ActivityManagerInternal.APP_TRANSITION_* reasons. */ void notifyTransitionStarting(SparseIntArray stackIdReasons) { - // TODO (b/36339388): Figure out why stackIdReasons can be null - if (stackIdReasons == null || !isAnyTransitionActive() || mLoggedTransitionStarting) { + if (!isAnyTransitionActive() || mLoggedTransitionStarting) { return; } mCurrentTransitionDelayMs = calculateCurrentDelay(); diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java index 64ab848a052e..0db1b5d547dc 100644 --- a/services/core/java/com/android/server/media/MediaSessionService.java +++ b/services/core/java/com/android/server/media/MediaSessionService.java @@ -965,7 +965,7 @@ public class MediaSessionService extends SystemService implements Monitor { final int uid = Binder.getCallingUid(); final long token = Binder.clearCallingIdentity(); try { - if (uid != Process.BLUETOOTH_UID) { + if (!UserHandle.isSameApp(uid, Process.BLUETOOTH_UID)) { throw new SecurityException("Only Bluetooth service processes can set" + " Callback"); } diff --git a/services/core/java/com/android/server/wm/AppWindowToken.java b/services/core/java/com/android/server/wm/AppWindowToken.java index 936739bf143e..847545af4abc 100644 --- a/services/core/java/com/android/server/wm/AppWindowToken.java +++ b/services/core/java/com/android/server/wm/AppWindowToken.java @@ -178,6 +178,8 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree private boolean mDisbalePreviewScreenshots; + Task mLastParent; + AppWindowToken(WindowManagerService service, IApplicationToken token, boolean voiceInteraction, DisplayContent dc, long inputDispatchingTimeoutNanos, boolean fullscreen, boolean showForAllUsers, int targetSdk, int orientation, int rotationAnimationHint, @@ -743,19 +745,21 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree void onParentSet() { super.onParentSet(); + final Task task = getTask(); + // When the associated task is {@code null}, the {@link AppWindowToken} can no longer // access visual elements like the {@link DisplayContent}. We must remove any associations // such as animations. if (!mReparenting) { - final Task task = getTask(); if (task == null) { // It is possible we have been marked as a closing app earlier. We must remove ourselves // from this list so we do not participate in any future animations. mService.mClosingApps.remove(this); - } else if (task.mStack != null) { + } else if (mLastParent != null && mLastParent.mStack != null) { task.mStack.mExitingAppTokens.remove(this); } } + mLastParent = task; } void postWindowRemoveStartingWindowCleanup(WindowState win) { diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 5fbc43f69c8d..2a01aa26c15f 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -5035,6 +5035,7 @@ public class WindowManagerService extends IWindowManager.Stub if (callback != null) { callback.run(); } + break; } case NEW_ANIMATOR_SCALE: { float scale = getCurrentAnimatorScale(); @@ -5087,6 +5088,7 @@ public class WindowManagerService extends IWindowManager.Stub } } } + break; case UPDATE_DOCKED_STACK_DIVIDER: { synchronized (mWindowMap) { final DisplayContent displayContent = getDefaultDisplayContentLocked(); @@ -5104,6 +5106,7 @@ public class WindowManagerService extends IWindowManager.Stub mWindowReplacementTimeouts.clear(); } } + break; case NOTIFY_APP_TRANSITION_STARTING: { mAmInternal.notifyAppTransitionStarting((SparseIntArray) msg.obj); } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 8ee6454ebd66..85f84ba7f8d9 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -883,16 +883,24 @@ public class TelephonyManager { /** * USSD return code success. + * @hide */ public static final int USSD_RETURN_SUCCESS = 100; /** - * USSD return code for failure case. + * Failed code returned when the mobile network has failed to complete a USSD request. + * <p> + * Returned via {@link TelephonyManager.UssdResponseCallback#onReceiveUssdResponseFailed( + * TelephonyManager, String, int)}. */ public static final int USSD_RETURN_FAILURE = -1; /** - * USSD return code for failure case. + * Failure code returned when a USSD request has failed to execute because the Telephony + * service is unavailable. + * <p> + * Returned via {@link TelephonyManager.UssdResponseCallback#onReceiveUssdResponseFailed( + * TelephonyManager, String, int)}. */ public static final int USSD_ERROR_SERVICE_UNAVAIL = -2; @@ -5133,27 +5141,39 @@ public class TelephonyManager { return new int[0]; } - /* The caller of {@link #sendUssdRequest(String, UssdResponseCallback, Handler} provides - * once the network returns a USSD message or if there is failure. - * Either {@link #onReceiveUssdResponse(TelephonyManager, String, CharSequence} or - * {@link #onReceiveUssdResponseFailed(TelephonyManager, String, int} will be called. + /** + * Used to notify callers of + * {@link TelephonyManager#sendUssdRequest(String, UssdResponseCallback, Handler)} when the + * network either successfully executes a USSD request, or if there was a failure while + * executing the request. + * <p> + * {@link #onReceiveUssdResponse(TelephonyManager, String, CharSequence)} will be called if the + * USSD request has succeeded. + * {@link #onReceiveUssdResponseFailed(TelephonyManager, String, int)} will be called if the + * USSD request has failed. */ public static abstract class UssdResponseCallback { /** - * Called when USSD has succeeded. The calling app can choose to either display the message - * or interpret the message. + * Called when a USSD request has succeeded. The {@code response} contains the USSD + * response received from the network. The calling app can choose to either display the + * response to the user or perform some operation based on the response. + * <p> + * USSD responses are unstructured text and their content is determined by the mobile network + * operator. + * * @param telephonyManager the TelephonyManager the callback is registered to. - * @param request the ussd code sent to the network. - * @param response the response from the network. + * @param request the USSD request sent to the mobile network. + * @param response the response to the USSD request provided by the mobile network. **/ public void onReceiveUssdResponse(final TelephonyManager telephonyManager, String request, CharSequence response) {}; /** - * Called when USSD has failed. - * @param telephonyManager the TelephonyManager the callback is registered to - * @param request the ussd code. - * @param failureCode failure code, should be either of + * Called when a USSD request has failed to complete. + * + * @param telephonyManager the TelephonyManager the callback is registered to. + * @param request the USSD request sent to the mobile network. + * @param failureCode failure code indicating why the request failed. Will be either * {@link TelephonyManager#USSD_RETURN_FAILURE} or * {@link TelephonyManager#USSD_ERROR_SERVICE_UNAVAIL}. **/ @@ -5162,8 +5182,8 @@ public class TelephonyManager { } /** - * Sends an Unstructured Supplementary Service Data (USSD) request to the cellular network and - * informs the caller of the response via {@code callback}. + * Sends an Unstructured Supplementary Service Data (USSD) request to the mobile network and + * informs the caller of the response via the supplied {@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: |