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

Commit 3d35a9bb authored by Jordan Liu's avatar Jordan Liu
Browse files

Add method to get phoneId from slotId

This is called in PhoneInterfaceManager

Bug: 126578014
Test: builds
Change-Id: I7f0b6a86bc259090a249fb56135c55d846cdbea2
Merged-In: I7f0b6a86bc259090a249fb56135c55d846cdbea2
parent 32d54dc2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -216,6 +216,21 @@ public class UiccController extends Handler {
        mDefaultEuiccCardId = TelephonyManager.UNINITIALIZED_CARD_ID;
    }

    /**
     * Given the slot index, return the phone ID, or -1 if no phone is associated with the given
     * slot.
     * @param slotId the slot index to check
     * @return the associated phone ID or -1
     */
    public int getPhoneIdFromSlotId(int slotId) {
        for (int i = 0; i < mPhoneIdToSlotId.length; i++) {
            if (mPhoneIdToSlotId[i] == slotId) {
                return i;
            }
        }
        return -1;
    }

    private int getSlotIdFromPhoneId(int phoneId) {
        return mPhoneIdToSlotId[phoneId];
    }