Update javadoc of TelephonyManager#isModemEnabledForSlot

The API has always been accessible for calling app with carrier
privilege in implementation. This should be specified explicitly
in javadoc to clarify the behavior.

The @RequrePermission annotation is also updated to include
both permissions to match the fact.

Bug: 201331955
Test: m offline-sdk-docs
Change-Id: I231a0907895846bef8a97856c77587ad68a98fb0
This commit is contained in:
Rambo Wang
2021-11-02 07:50:39 -07:00
parent d69e2b3f13
commit 5c30cc752b
2 changed files with 9 additions and 6 deletions

View File

@@ -42738,7 +42738,7 @@ package android.telephony {
method public boolean isEmergencyNumber(@NonNull String);
method public boolean isHearingAidCompatibilitySupported();
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PRECISE_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public boolean isManualNetworkSelectionAllowed();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isModemEnabledForSlot(int);
method @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "android.permission.READ_PRIVILEGED_PHONE_STATE"}) public boolean isModemEnabledForSlot(int);
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int isMultiSimSupported();
method public boolean isNetworkRoaming();
method public boolean isRadioInterfaceCapabilitySupported(@NonNull String);

View File

@@ -13547,15 +13547,18 @@ public class TelephonyManager {
}
/**
* It indicates whether modem is enabled or not per slot.
* It's the corresponding status of TelephonyManager.enableModemForSlot.
* Indicates whether or not there is a modem stack enabled for the given SIM slot.
*
* <p>Requires Permission:
* READ_PRIVILEGED_PHONE_STATE or
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE},
* READ_PRIVILEGED_PHONE_STATE or that the calling app has carrier privileges (see
* {@link #hasCarrierPrivileges()}).
*
* @param slotIndex which slot it's checking.
*/
@RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(anyOf = {android.Manifest.permission.READ_PHONE_STATE,
android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE})
public boolean isModemEnabledForSlot(int slotIndex) {
try {
ITelephony telephony = getITelephony();