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

Commit f89c1e73 authored by Shuo Qian's avatar Shuo Qian
Browse files

Revert "Make SubscriptionManager.getSlotIndex public"

This reverts commit ccea7355.

Reason for revert: broke some esim usage (bug#116861976)

Change-Id: I8e6debac959460954ba4c16ef4c0e2ebcc68b5ec
Bug: 116861976
Bug: 113072551
parent ccea7355
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -42778,7 +42778,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 isNetworkRoaming(int);
@@ -42796,9 +42795,7 @@ package android.telephony {
    field public static final int DATA_ROAMING_DISABLE = 0; // 0x0
    field public static final int DATA_ROAMING_ENABLE = 1; // 0x1
    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 caller wants the default sub id. */
    /** @hide */
@@ -138,8 +139,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.
@@ -1262,22 +1264,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;
@@ -1285,7 +1281,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