Merge "API Council Feedbacks" into rvc-dev

This commit is contained in:
Shuo Qian
2020-03-18 17:15:36 +00:00
committed by Android (Google) Code Review
3 changed files with 18 additions and 3 deletions

View File

@@ -17,6 +17,8 @@
package android.os;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
/**
@@ -125,6 +127,7 @@ public final class ConfigUpdate {
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.UPDATE_CONFIG)
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
public static final String ACTION_UPDATE_EMERGENCY_NUMBER_DB =
"android.os.action.UPDATE_EMERGENCY_NUMBER_DB";

View File

@@ -571,6 +571,19 @@ public class Annotation {
public @interface PreciseDisconnectCauses {
}
/**
* Carrier Privilege Status.
*/
@IntDef(prefix = { "CARRIER_PRIVILEGE_STATUS_" }, value = {
TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS,
TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS,
TelephonyManager.CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED,
TelephonyManager.CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES,
})
@Retention(RetentionPolicy.SOURCE)
public @interface CarrierPrivilegeStatus {
}
@IntDef({
Connection.AUDIO_CODEC_NONE,
Connection.AUDIO_CODEC_AMR,

View File

@@ -71,6 +71,7 @@ import android.telecom.PhoneAccountHandle;
import android.telecom.TelecomManager;
import android.telephony.Annotation.ApnType;
import android.telephony.Annotation.CallState;
import android.telephony.Annotation.CarrierPrivilegeStatus;
import android.telephony.Annotation.NetworkType;
import android.telephony.Annotation.RadioPowerState;
import android.telephony.Annotation.SimActivationState;
@@ -11162,8 +11163,6 @@ public class TelephonyManager {
retVal = telephony.isDataEnabled(subId);
} catch (RemoteException e) {
Log.e(TAG, "Error isDataConnectionAllowed", e);
} catch (NullPointerException e) {
return false;
}
return retVal;
}
@@ -12450,7 +12449,7 @@ public class TelephonyManager {
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE)
public int getCarrierPrivilegeStatus(int uid) {
public @CarrierPrivilegeStatus int getCarrierPrivilegeStatus(int uid) {
try {
ITelephony telephony = getITelephony();
if (telephony != null) {