Exposed getAllSubscriptionInfoList and getSubscriptionId
1. Added getAllSubscriptionInfoList for getting all the subscriptions from the subscription database. 2. Added getSubscriptionId for getting the active subscription id from the specified slot. 3. Deprecated getSubscriptionIds, which is imposible to return more than one subscription in today's implementation. Fix: 261041952 Test: Manual + CTS Change-Id: I9396f8e329ecec815d7a4aecba0d10c1a2a9c8c7
This commit is contained in:
@@ -44099,6 +44099,7 @@ package android.telephony {
|
||||
method public int getActiveSubscriptionInfoCountMax();
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public android.telephony.SubscriptionInfo getActiveSubscriptionInfoForSimSlotIndex(int);
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telephony.SubscriptionInfo> getActiveSubscriptionInfoList();
|
||||
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_STATE, "carrier privileges"}) public java.util.List<android.telephony.SubscriptionInfo> getAllSubscriptionInfoList();
|
||||
method @NonNull public java.util.List<android.telephony.SubscriptionInfo> getCompleteActiveSubscriptionInfoList();
|
||||
method public static int getDefaultDataSubscriptionId();
|
||||
method public static int getDefaultSmsSubscriptionId();
|
||||
@@ -44110,7 +44111,8 @@ package android.telephony {
|
||||
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_NUMBERS, "android.permission.READ_PRIVILEGED_PHONE_STATE", "carrier privileges"}) public String getPhoneNumber(int, int);
|
||||
method @NonNull @RequiresPermission(anyOf={android.Manifest.permission.READ_PHONE_NUMBERS, "android.permission.READ_PRIVILEGED_PHONE_STATE", "carrier privileges"}) public String getPhoneNumber(int);
|
||||
method public static int getSlotIndex(int);
|
||||
method @Nullable public int[] getSubscriptionIds(int);
|
||||
method public static int getSubscriptionId(int);
|
||||
method @Deprecated @Nullable public int[] getSubscriptionIds(int);
|
||||
method @NonNull public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
|
||||
method @NonNull @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public java.util.List<android.telephony.SubscriptionInfo> getSubscriptionsInGroup(@NonNull android.os.ParcelUuid);
|
||||
method @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public boolean isActiveSubscriptionId(int);
|
||||
|
||||
@@ -1730,31 +1730,30 @@ public class SubscriptionManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all subscription info records from SIMs that are inserted now or were inserted before.
|
||||
* Get all subscription info records from SIMs that are inserted now or previously inserted.
|
||||
*
|
||||
* <p>
|
||||
* If the caller does not have {@link Manifest.permission#READ_PHONE_NUMBERS} permission,
|
||||
* {@link SubscriptionInfo#getNumber()} will return empty string.
|
||||
* If the caller does not have {@link Manifest.permission#USE_ICC_AUTH_WITH_DEVICE_IDENTIFIER},
|
||||
* {@link SubscriptionInfo#getIccId()} and {@link SubscriptionInfo#getCardString()} will return
|
||||
* empty string, and {@link SubscriptionInfo#getGroupUuid()} will return {@code null}.
|
||||
* {@link SubscriptionInfo#getIccId()} will return an empty string, and
|
||||
* {@link SubscriptionInfo#getGroupUuid()} will return {@code null}.
|
||||
*
|
||||
* <p>
|
||||
* The carrier app will always have full {@link SubscriptionInfo} for the subscriptions
|
||||
* that it has carrier privilege.
|
||||
* The carrier app will only get the list of subscriptions that it has carrier privilege on,
|
||||
* but will have non-stripped {@link SubscriptionInfo} in the list.
|
||||
*
|
||||
* @return List of all {@link SubscriptionInfo} records from SIMs that are inserted or
|
||||
* inserted before. Sorted by {@link SubscriptionInfo#getSimSlotIndex()}, then
|
||||
* previously inserted. Sorted by {@link SubscriptionInfo#getSimSlotIndex()}, then
|
||||
* {@link SubscriptionInfo#getSubscriptionId()}.
|
||||
*
|
||||
* @hide
|
||||
* @throws SecurityException if callers do not hold the required permission.
|
||||
*/
|
||||
@NonNull
|
||||
@RequiresPermission(anyOf = {
|
||||
Manifest.permission.READ_PHONE_STATE,
|
||||
Manifest.permission.READ_PRIVILEGED_PHONE_STATE,
|
||||
"carrier privileges",
|
||||
})
|
||||
@NonNull
|
||||
public List<SubscriptionInfo> getAllSubscriptionInfoList() {
|
||||
List<SubscriptionInfo> result = null;
|
||||
try {
|
||||
@@ -2228,13 +2227,23 @@ public class SubscriptionManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of Subscription Ids for specified slot Index.
|
||||
* @param slotIndex the slot index.
|
||||
* @return subscription Ids or null if the given slot Index is not valid or there are no active
|
||||
* subscriptions in the slot.
|
||||
* Get an array of subscription ids for specified logical SIM slot Index.
|
||||
*
|
||||
* @param slotIndex The logical SIM slot index.
|
||||
*
|
||||
* @return subscription Ids or {@code null} if the given slot index is not valid or there are
|
||||
* no active subscription in the slot. In the implementation today, there will be no more
|
||||
* than one subscriptions per logical SIM slot.
|
||||
*
|
||||
* @deprecated Use {@link #getSubscriptionId(int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
@Nullable
|
||||
public int[] getSubscriptionIds(int slotIndex) {
|
||||
int subId = getSubscriptionId(slotIndex);
|
||||
if (!isValidSubscriptionId(subId)) {
|
||||
return null;
|
||||
}
|
||||
return new int[]{getSubscriptionId(slotIndex)};
|
||||
}
|
||||
|
||||
@@ -2261,12 +2270,10 @@ public class SubscriptionManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the subscription id for specified slot index.
|
||||
* Get the subscription id for specified logical SIM slot index.
|
||||
*
|
||||
* @param slotIndex Logical SIM slot index.
|
||||
* @param slotIndex The logical SIM slot index.
|
||||
* @return The subscription id. {@link #INVALID_SUBSCRIPTION_ID} if SIM is absent.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public static int getSubscriptionId(int slotIndex) {
|
||||
if (!isValidSlotIndex(slotIndex)) {
|
||||
|
||||
Reference in New Issue
Block a user