summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jordan Liu <jminjie@google.com> 2018-12-12 22:20:03 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2018-12-12 22:20:03 +0000
commit97c68169b8d1f77acb43a52c05388c9e4354770b (patch)
tree5bbe37485189cdf207f586318a6fad4dcff7491f
parentbfb6086f67b924df1851f0b35c1efd79cc4a70d9 (diff)
parent2fe9e3748ae17ed15e7b3ff28139b91d00d0350e (diff)
Merge "Add API to get card ID for default eUICC"
-rw-r--r--api/system-current.txt2
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java35
-rw-r--r--telephony/java/com/android/internal/telephony/ITelephony.aidl13
3 files changed, 50 insertions, 0 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 87bff668d9c8..fd2e05e9e7d1 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -5218,6 +5218,7 @@ package android.telephony {
method public void enableVideoCalling(boolean);
method public java.lang.String getAidForAppType(int);
method public java.util.List<android.service.carrier.CarrierIdentifier> getAllowedCarriers(int);
+ method public int getCardIdForDefaultEuicc();
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntent(android.content.Intent);
method public java.util.List<java.lang.String> getCarrierPackageNamesForIntentAndPhone(android.content.Intent, int);
method public java.lang.String getCdmaMdn();
@@ -5283,6 +5284,7 @@ package android.telephony {
field public static final java.lang.String EXTRA_SIM_STATE = "android.telephony.extra.SIM_STATE";
field public static final java.lang.String EXTRA_VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL = "android.telephony.extra.VISUAL_VOICEMAIL_ENABLED_BY_USER_BOOL";
field public static final java.lang.String EXTRA_VOICEMAIL_SCRAMBLED_PIN_STRING = "android.telephony.extra.VOICEMAIL_SCRAMBLED_PIN_STRING";
+ field public static final int INVALID_CARD_ID = -1; // 0xffffffff
field public static final long MAX_NUMBER_VERIFICATION_TIMEOUT_MILLIS = 60000L; // 0xea60L
field public static final int NETWORK_MODE_CDMA_EVDO = 4; // 0x4
field public static final int NETWORK_MODE_CDMA_NO_EVDO = 5; // 0x5
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index a976fe6ef2fe..4290ab3b1318 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -225,6 +225,13 @@ public class TelephonyManager {
@SystemApi
public static final int SRVCC_STATE_HANDOVER_CANCELED = 3;
+ /**
+ * An invalid card identifier.
+ * @hide
+ */
+ @SystemApi
+ public static final int INVALID_CARD_ID = -1;
+
/** @hide */
@Retention(RetentionPolicy.SOURCE)
@IntDef(prefix = {"SRVCC_STATE_"},
@@ -3094,6 +3101,34 @@ public class TelephonyManager {
}
/**
+ * Get the card ID of the default eUICC card. If there is no eUICC, returns
+ * {@link #INVALID_CARD_ID}.
+ *
+ * <p>The card ID is a unique identifier associated with a UICC or eUICC card. Card IDs are
+ * unique to a device, and always refer to the same UICC or eUICC card unless the device goes
+ * through a factory reset.
+ *
+ * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ *
+ * @return card ID of the default eUICC card.
+ * @hide
+ */
+ @SystemApi
+ @SuppressAutoDoc // Blocked by b/72967236 - no support for carrier privileges
+ @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE)
+ public int getCardIdForDefaultEuicc() {
+ try {
+ ITelephony telephony = getITelephony();
+ if (telephony == null) {
+ return INVALID_CARD_ID;
+ }
+ return telephony.getCardIdForDefaultEuicc(mSubId, mContext.getOpPackageName());
+ } catch (RemoteException e) {
+ return INVALID_CARD_ID;
+ }
+ }
+
+ /**
* Gets all the UICC slots. The objects in the array can be null if the slot info is not
* available, which is possible between phone process starting and getting slot info from modem.
*
diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl
index 8a1fb7bc8ff0..5a06f6aaf7ea 100644
--- a/telephony/java/com/android/internal/telephony/ITelephony.aidl
+++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl
@@ -1482,6 +1482,19 @@ interface ITelephony {
SignalStrength getSignalStrength(int subId);
/**
+ * Get the card ID of the default eUICC card. If there is no eUICC, returns
+ * {@link #INVALID_CARD_ID}.
+ *
+ * <p>Requires Permission: {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ *
+ * @param subId subscription ID used for authentication
+ * @param callingPackage package making the call
+ * @return card ID of the default eUICC card.
+ * @hide
+ */
+ int getCardIdForDefaultEuicc(int subId, String callingPackage);
+
+ /**
* Get slot info for all the UICC slots.
* @return UiccSlotInfo array.
* @hide