From 28911517b22cb3c206f25e52671e2adff8b41ff3 Mon Sep 17 00:00:00 2001 From: Jordan Liu Date: Wed, 27 Feb 2019 14:44:20 -0800 Subject: [PATCH] Update annotations for UiccCardInfo APIs Fixes: 124800040 Test: no change to behavior Change-Id: I0644eb9bac417b9a8b0fd8eaf691728ed0784527 --- api/current.txt | 6 +++--- telephony/java/android/telephony/TelephonyManager.java | 1 + telephony/java/android/telephony/UiccCardInfo.java | 9 +++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/api/current.txt b/api/current.txt index 172140fd653fe..d022729e1eafb 100755 --- a/api/current.txt +++ b/api/current.txt @@ -43068,7 +43068,7 @@ package android.telephony { method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getSubscriberId(); method public String getTypeAllocationCode(); method public String getTypeAllocationCode(int); - method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") public java.util.List getUiccCardsInfo(); + method @RequiresPermission("android.permission.READ_PRIVILEGED_PHONE_STATE") @NonNull public java.util.List getUiccCardsInfo(); method @Nullable @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVisualVoicemailPackageName(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailAlphaTag(); method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public String getVoiceMailNumber(); @@ -43237,8 +43237,8 @@ package android.telephony { ctor public UiccCardInfo(boolean, int, String, String, int); method public int describeContents(); method public int getCardId(); - method public String getEid(); - method public String getIccId(); + method @Nullable public String getEid(); + method @Nullable public String getIccId(); method public int getSlotIndex(); method public boolean isEuicc(); method public void writeToParcel(android.os.Parcel, int); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 1433b2ac92809..c0bb1231ed4a5 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -3182,6 +3182,7 @@ public class TelephonyManager { * the caller does not have adequate permissions for that card. */ @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) + @NonNull public List getUiccCardsInfo() { try { ITelephony telephony = getITelephony(); diff --git a/telephony/java/android/telephony/UiccCardInfo.java b/telephony/java/android/telephony/UiccCardInfo.java index 19f357a14687d..fff8485fdcb7b 100644 --- a/telephony/java/android/telephony/UiccCardInfo.java +++ b/telephony/java/android/telephony/UiccCardInfo.java @@ -15,6 +15,8 @@ */ package android.telephony; +import android.annotation.NonNull; +import android.annotation.Nullable; import android.os.Parcel; import android.os.Parcelable; @@ -96,6 +98,7 @@ public final class UiccCardInfo implements Parcelable { * Note that this field may be omitted if the caller does not have the correct permissions * (see {@link TelephonyManager#getUiccCardsInfo()}). */ + @Nullable public String getEid() { if (!mIsEuicc) { return null; @@ -109,6 +112,7 @@ public final class UiccCardInfo implements Parcelable { * Note that this field may be omitted if the caller does not have the correct permissions * (see {@link TelephonyManager#getUiccCardsInfo()}). */ + @Nullable public String getIccId() { return mIccId; } @@ -121,11 +125,12 @@ public final class UiccCardInfo implements Parcelable { } /** - * Returns a copy of the UiccCardinfo with the clears the EID and ICCID set to null. These - * values are generally private and require carrier privileges to view. + * Returns a copy of the UiccCardinfo with the EID and ICCID set to null. These values are + * generally private and require carrier privileges to view. * * @hide */ + @NonNull public UiccCardInfo getUnprivileged() { return new UiccCardInfo(mIsEuicc, mCardId, null, null, mSlotIndex); }