diff options
| author | 2018-09-12 16:31:17 -0700 | |
|---|---|---|
| committer | 2018-10-05 13:47:53 -0700 | |
| commit | 798da56c92f3747732415673ca6c6741595d22b3 (patch) | |
| tree | 1f77443730b8f2d7a700d719ffdb37b6a043eacb | |
| parent | 57e5e6838537f8b7587557b4210aad7c29248dbd (diff) | |
Make isUsableSubIdValue public
Rename subId to subscriptionId
Bug: 113072551
Test: Treehugger
Change-Id: I54303bab4d40d6168332d0263e9de1603205bb75
| -rwxr-xr-x | api/current.txt | 2 | ||||
| -rw-r--r-- | telephony/java/android/telephony/SubscriptionManager.java | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/api/current.txt b/api/current.txt index 2a1295c1ed02..bff46b1a0dcf 100755 --- a/api/current.txt +++ b/api/current.txt @@ -42457,6 +42457,7 @@ package android.telephony { method public static int[] getSubscriptionIds(int); method public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int); method public boolean isNetworkRoaming(int); + method public static boolean isUsableSubscriptionId(int); method public static boolean isValidSubscriptionId(int); method public void removeOnOpportunisticSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener); method public void removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener); @@ -42470,6 +42471,7 @@ package android.telephony { field public static final java.lang.String ACTION_REFRESH_SUBSCRIPTION_PLANS = "android.telephony.action.REFRESH_SUBSCRIPTION_PLANS"; field public static final int DATA_ROAMING_DISABLE = 0; // 0x0 field public static final int DATA_ROAMING_ENABLE = 1; // 0x1 + field public static final int DEFAULT_SUBSCRIPTION_ID = 2147483647; // 0x7fffffff field public static final java.lang.String EXTRA_SUBSCRIPTION_INDEX = "android.telephony.extra.SUBSCRIPTION_INDEX"; field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff } diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java index 0c8280b9e086..45afde6dbdce 100644 --- a/telephony/java/android/telephony/SubscriptionManager.java +++ b/telephony/java/android/telephony/SubscriptionManager.java @@ -88,9 +88,7 @@ public class SubscriptionManager { /** @hide */ public static final int INVALID_SIM_SLOT_INDEX = -1; - /** Indicates the caller wants the default sub id. */ - /** @hide */ - @UnsupportedAppUsage + /** Indicates the default subscription ID in Telephony. */ public static final int DEFAULT_SUBSCRIPTION_ID = Integer.MAX_VALUE; /** @@ -1600,6 +1598,19 @@ public class SubscriptionManager { } /** + * Check if the subscription ID is usable. + * + * A usable subscription ID has a valid value except some special values such as + * {@link DEFAULT_SUBSCRIPTION_ID}. It can be used for subscription functions. + * + * @param subscriptionId the subscription ID + * @return {@code true} if the subscription ID is usable; {@code false} otherwise. + */ + public static boolean isUsableSubscriptionId(int subscriptionId) { + return isUsableSubIdValue(subscriptionId); + } + + /** * @return true if subId is an usable subId value else false. A * usable subId means its neither a INVALID_SUBSCRIPTION_ID nor a DEFAULT_SUB_ID. * @hide |