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

Commit 4d551c66 authored by Jordan Liu's avatar Jordan Liu Committed by android-build-merger
Browse files

Merge "Add method to get phoneId from slotId"

am: b37d524c

Change-Id: I9e676efab831eacfb7365beabc6963f553cd00a7
parents 0aaa43c2 b37d524c
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -226,6 +226,21 @@ public class UiccController extends Handler {
        mDefaultEuiccCardId = UNINITIALIZED_CARD_ID;
        mDefaultEuiccCardId = 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) {
    private int getSlotIdFromPhoneId(int phoneId) {
        return mPhoneIdToSlotId[phoneId];
        return mPhoneIdToSlotId[phoneId];
    }
    }