diff options
author | Meng Wang <mewan@google.com> | 2019-11-26 00:13:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-11-26 00:13:00 +0000 |
commit | afb05a64c1b81c669e9c334039b06bd44952bdb3 (patch) | |
tree | 598540a34f6b3cbc63a12018edc4278de0f43df3 | |
parent | 2f1c32ef23537c32d47af901fd201a0ff6912ed4 (diff) | |
parent | 3dfc84ef72875fe2611b0ef915d327b7da08ad0f (diff) |
Merge "Expose API isInEmergencySmsMode"
-rw-r--r-- | api/system-current.txt | 1 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/api/system-current.txt b/api/system-current.txt index 23c581068be8..a135f55b0428 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -8637,6 +8637,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isDataEnabledForApn(int); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isEmergencyAssistanceEnabled(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isIdle(); + method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInEmergencySmsMode(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isOffhook(); method @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isPotentialEmergencyNumber(@NonNull String); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, android.Manifest.permission.READ_PHONE_STATE}) public boolean isRadioOn(); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 1fc929f3d162..2925b1154f14 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -7594,20 +7594,20 @@ public class TelephonyManager { * {@link CarrierConfigManager#KEY_EMERGENCY_SMS_MODE_TIMER_MS_INT}. If * the carrier does not support this mode, this function will always return false. * - * @return true if this device is in emergency SMS mode, false otherwise. + * @return {@code true} if this device is in emergency SMS mode, {@code false} otherwise. * * @hide */ + @SystemApi @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) public boolean isInEmergencySmsMode() { - try { ITelephony telephony = getITelephony(); if (telephony != null) { return telephony.isInEmergencySmsMode(); } } catch (RemoteException ex) { - Rlog.e(TAG, "getNetworkSelectionMode RemoteException", ex); + Rlog.e(TAG, "isInEmergencySmsMode RemoteException", ex); } return false; } |