Expose API isInEmergencySmsMode

Bug: 140908357
Test: cts
Change-Id: Ib9c1a4e05f5c8417b93e11cdf6bf81304e57eaec
This commit is contained in:
Meng Wang
2019-11-25 10:20:54 -08:00
parent f80a75182c
commit 064b674358
2 changed files with 4 additions and 3 deletions

View File

@@ -9083,6 +9083,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 public boolean isModemEnabledForSlot(int);
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 isOpportunisticNetworkEnabled();

View File

@@ -7747,20 +7747,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;
}