From fd4d6af2e4fb73ed6f96bcaf1b7e2ac8e277b5d2 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Wed, 26 Feb 2020 13:22:02 -0800 Subject: [PATCH] Update EmergencyNumber API docs to indicate they can throw. Adding @throws tags for EmergencyNumber APIs so that callers are aware that they can throw. Test: Build; docs only change. Bug: 134100020 Change-Id: Ib26c93355a0c43744787f0eacf5c6c2e50a12474 --- telephony/java/android/telephony/TelephonyManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index e97b6eeb97b61..ad6e4c42e0aa4 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -11624,6 +11624,7 @@ public class TelephonyManager { * subscription, the key is {@link SubscriptionManager#getDefaultSubscriptionId}) and the value * as the list of {@link EmergencyNumber}; empty Map if this information is not available; * or throw a SecurityException if the caller does not have the permission. + * @throws IllegalStateException if the Telephony process is not currently available. */ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) @NonNull @@ -11671,6 +11672,7 @@ public class TelephonyManager { * @param number - the number to look up * @return {@code true} if the given number is an emergency number based on current locale, * SIM card(s), Android database, modem, network or defaults; {@code false} otherwise. + * @throws IllegalStateException if the Telephony process is not currently available. */ public boolean isEmergencyNumber(@NonNull String number) { try { @@ -11706,7 +11708,7 @@ public class TelephonyManager { * the same digits of any current emergency number based on current locale, sim, modem and * network; {@code false} if it is not; or throw an SecurityException if the caller does not * have the required permission/privileges - * + * @throws IllegalStateException if the Telephony process is not currently available. * @hide */ @SystemApi