Merge "Update docs and add nullability annotations"

This commit is contained in:
Treehugger Robot
2020-10-12 22:09:38 +00:00
committed by Gerrit Code Review
3 changed files with 13 additions and 7 deletions

View File

@@ -48279,7 +48279,7 @@ package android.telephony {
method @Deprecated public int getPhoneCount(); method @Deprecated public int getPhoneCount();
method public int getPhoneType(); method public int getPhoneType();
method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription(); method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription();
method @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.ACCESS_COARSE_LOCATION}) public android.telephony.ServiceState getServiceState(); method @Nullable @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.ACCESS_COARSE_LOCATION}) public android.telephony.ServiceState getServiceState();
method @Nullable public android.telephony.SignalStrength getSignalStrength(); method @Nullable public android.telephony.SignalStrength getSignalStrength();
method public int getSimCarrierId(); method public int getSimCarrierId();
method @Nullable public CharSequence getSimCarrierIdName(); method @Nullable public CharSequence getSimCarrierIdName();
@@ -48302,7 +48302,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getVoiceNetworkType(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getVoiceNetworkType();
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method @Nullable public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean hasCarrierPrivileges(); method public boolean hasCarrierPrivileges();
method public boolean hasIccCard(); method public boolean hasIccCard();
method @Deprecated public boolean iccCloseLogicalChannel(int); method @Deprecated public boolean iccCloseLogicalChannel(int);

View File

@@ -46447,7 +46447,7 @@ package android.telephony {
method @Deprecated public int getPhoneCount(); method @Deprecated public int getPhoneCount();
method public int getPhoneType(); method public int getPhoneType();
method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription(); method @RequiresPermission(anyOf={"android.permission.READ_PRIVILEGED_PHONE_STATE", android.Manifest.permission.READ_PHONE_STATE}) public int getPreferredOpportunisticDataSubscription();
method @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.ACCESS_COARSE_LOCATION}) public android.telephony.ServiceState getServiceState(); method @Nullable @RequiresPermission(allOf={android.Manifest.permission.READ_PHONE_STATE, android.Manifest.permission.ACCESS_COARSE_LOCATION}) public android.telephony.ServiceState getServiceState();
method @Nullable public android.telephony.SignalStrength getSignalStrength(); method @Nullable public android.telephony.SignalStrength getSignalStrength();
method public int getSimCarrierId(); method public int getSimCarrierId();
method @Nullable public CharSequence getSimCarrierIdName(); method @Nullable public CharSequence getSimCarrierIdName();
@@ -46470,7 +46470,7 @@ package android.telephony {
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber();
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getVoiceNetworkType(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public int getVoiceNetworkType();
method public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle); method @Nullable public android.net.Uri getVoicemailRingtoneUri(android.telecom.PhoneAccountHandle);
method public boolean hasCarrierPrivileges(); method public boolean hasCarrierPrivileges();
method public boolean hasIccCard(); method public boolean hasIccCard();
method @Deprecated public boolean iccCloseLogicalChannel(int); method @Deprecated public boolean iccCloseLogicalChannel(int);

View File

@@ -10326,19 +10326,25 @@ public class TelephonyManager {
* <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
* or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges}) * or that the calling app has carrier privileges (see {@link #hasCarrierPrivileges})
* and {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}. * and {@link android.Manifest.permission#ACCESS_COARSE_LOCATION}.
*
* May return {@code null} when the subscription is inactive or when there was an error
* communicating with the phone process.
*/ */
@SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
@RequiresPermission(allOf = { @RequiresPermission(allOf = {
Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_PHONE_STATE,
Manifest.permission.ACCESS_COARSE_LOCATION Manifest.permission.ACCESS_COARSE_LOCATION
}) })
public ServiceState getServiceState() { public @Nullable ServiceState getServiceState() {
return getServiceStateForSubscriber(getSubId()); return getServiceStateForSubscriber(getSubId());
} }
/** /**
* Returns the service state information on specified subscription. Callers require * Returns the service state information on specified subscription. Callers require
* either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE to retrieve the information. * either READ_PRIVILEGED_PHONE_STATE or READ_PHONE_STATE to retrieve the information.
*
* May return {@code null} when the subscription is inactive or when there was an error
* communicating with the phone process.
* @hide * @hide
*/ */
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P) @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.P)
@@ -10365,9 +10371,9 @@ public class TelephonyManager {
* @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the * @param accountHandle The handle for the {@link PhoneAccount} for which to retrieve the
* voicemail ringtone. * voicemail ringtone.
* @return The URI for the ringtone to play when receiving a voicemail from a specific * @return The URI for the ringtone to play when receiving a voicemail from a specific
* PhoneAccount. * PhoneAccount. May be {@code null} if no ringtone is set.
*/ */
public Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) { public @Nullable Uri getVoicemailRingtoneUri(PhoneAccountHandle accountHandle) {
try { try {
ITelephony service = getITelephony(); ITelephony service = getITelephony();
if (service != null) { if (service != null) {