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

Commit 45540cd5 authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Changing getSimState to use slot idx instead of sub id.

Bug: 20736251
Change-Id: I43ec6450358f833f878ed4eee993ea79d5220c65
parent 3b413ed5
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -1668,19 +1668,18 @@ public class SubscriptionController extends ISub.Stub {
    }

    /**
     * Get the SIM state for the subscriber
     * Get the SIM state for the slot idx
     * @return SIM state as the ordinal of {@See IccCardConstants.State}
     */
    @Override
    public int getSimStateForSubscriber(int subId) {
    public int getSimStateForSlotIdx(int slotIdx) {
        State simState;
        String err;
        int phoneIdx = getPhoneId(subId);
        if (phoneIdx < 0) {
        if (slotIdx < 0) {
            simState = IccCardConstants.State.UNKNOWN;
            err = "invalid PhoneIdx";
            err = "invalid slotIdx";
        } else {
            Phone phone = PhoneFactory.getPhone(phoneIdx);
            Phone phone = PhoneFactory.getPhone(slotIdx);
            if (phone == null) {
                simState = IccCardConstants.State.UNKNOWN;
                err = "phone == null";
@@ -1695,7 +1694,7 @@ public class SubscriptionController extends ISub.Stub {
                }
            }
        }
        if (DBG) logd("getSimStateForSubscriber: " + err + " simState=" + simState
        if (DBG) logd("getSimStateForSlotIdx: " + err + " simState=" + simState
                + " ordinal=" + simState.ordinal());
        return simState.ordinal();
    }