Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4cfbf48 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Revert "Make SubscriptionManager.getSlotIndex public""

parents 35315bdb f89c1e73
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -42968,7 +42968,6 @@ package android.telephony {
    method public static int getDefaultSubscriptionId();
    method public static int getDefaultVoiceSubscriptionId();
    method public java.util.List<android.telephony.SubscriptionInfo> getOpportunisticSubscriptions(int);
    method public static int getSlotIndex(int);
    method public static int[] getSubscriptionIds(int);
    method public java.util.List<android.telephony.SubscriptionPlan> getSubscriptionPlans(int);
    method public boolean isActiveSubscriptionId(int);
@@ -42989,9 +42988,7 @@ package android.telephony {
    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_SIM_SLOT_INDEX = -2; // 0xfffffffe
    field public static final int INVALID_SUBSCRIPTION_ID = -1; // 0xffffffff
    field public static final int SIM_NOT_INSERTED = -3; // 0xfffffffd
  }
  public static class SubscriptionManager.OnOpportunisticSubscriptionsChangedListener {
+15 −19
Original line number Diff line number Diff line
@@ -86,8 +86,9 @@ public class SubscriptionManager {
    /** @hide */
    public static final int INVALID_PHONE_INDEX = -1;

    /** Indicates invalid sim slot. This can be returned by {@link #getSlotIndex(int)}. */
    public static final int INVALID_SIM_SLOT_INDEX = -2;
    /** An invalid slot identifier */
    /** @hide */
    public static final int INVALID_SIM_SLOT_INDEX = -1;

    /** Indicates the default subscription ID in Telephony. */
    public static final int DEFAULT_SUBSCRIPTION_ID = Integer.MAX_VALUE;
@@ -136,8 +137,9 @@ public class SubscriptionManager {
    /** @hide */
    public static final String SIM_SLOT_INDEX = "sim_id";

    /** Indicates SIM is not inserted. This can be returned by {@link #getSlotIndex(int)}. */
    public static final int SIM_NOT_INSERTED = -3;
    /** SIM is not inserted */
    /** @hide */
    public static final int SIM_NOT_INSERTED = -1;

    /**
     * TelephonyProvider column name for user displayed name.
@@ -1260,22 +1262,16 @@ public class SubscriptionManager {

    /**
     * Get slotIndex associated with the subscription.
     *
     * @param subscriptionId the unique SubscriptionInfo index in database
     * @return slotIndex as a positive integer or a negative value,
     * <ol>
     * <li>{@link #INVALID_SUBSCRIPTION_ID} if the supplied subscriptionId is invalid </li>
     * <li>{@link #SIM_NOT_INSERTED} if sim is not inserted </li>
     * <li>{@link #INVALID_SIM_SLOT_INDEX} if the supplied subscriptionId doesn't have an
     *     associated slot index </li>
     * </ol>
     */
    public static int getSlotIndex(int subscriptionId) {
        if (!isValidSubscriptionId(subscriptionId)) {
     * @return slotIndex as a positive integer or a negative value if an error either
     * SIM_NOT_INSERTED or < 0 if an invalid slot index
     * @hide
     */
    @UnsupportedAppUsage
    public static int getSlotIndex(int subId) {
        if (!isValidSubscriptionId(subId)) {
            if (DBG) {
                logd("[getSlotIndex]- supplied subscriptionId is invalid. ");
                logd("[getSlotIndex]- fail");
            }
            return INVALID_SUBSCRIPTION_ID;
        }

        int result = INVALID_SIM_SLOT_INDEX;
@@ -1283,7 +1279,7 @@ public class SubscriptionManager {
        try {
            ISub iSub = ISub.Stub.asInterface(ServiceManager.getService("isub"));
            if (iSub != null) {
                result = iSub.getSlotIndex(subscriptionId);
                result = iSub.getSlotIndex(subId);
            }
        } catch (RemoteException ex) {
            // ignore it