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

Commit 041732b6 authored by Yoshiaki Naka's avatar Yoshiaki Naka Committed by android-build-merger
Browse files

Merge "Avoid ArrayIndexOutOfBoundsException thrown because of unexpected slot"...

Merge "Avoid ArrayIndexOutOfBoundsException thrown because of unexpected slot" am: 93a999c0 am: 484be23d
am: 4ebf6dfc

Change-Id: I9c3969d7cd3d221e78fbb37e0e3aaaa115388915
parents 15b082c1 4ebf6dfc
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -830,7 +830,17 @@ public class UiccController extends Handler {
        boolean isDefaultEuiccCardIdSet = false;
        boolean anyEuiccIsActive = false;
        mHasActiveBuiltInEuicc = false;
        for (int i = 0; i < status.size(); i++) {

        int numSlots = status.size();
        if (mUiccSlots.length < numSlots) {
            String logStr = "The number of the physical slots reported " + numSlots
                    + " is greater than the expectation " + mUiccSlots.length + ".";
            Rlog.e(LOG_TAG, logStr);
            sLocalLog.log(logStr);
            numSlots = mUiccSlots.length;
        }

        for (int i = 0; i < numSlots; i++) {
            IccSlotStatus iss = status.get(i);
            boolean isActive = (iss.slotState == IccSlotStatus.SlotState.SLOTSTATE_ACTIVE);
            if (isActive) {
@@ -895,7 +905,7 @@ public class UiccController extends Handler {
            // Note that on HAL<1.2, it's possible that a built-in eUICC exists, but does not
            // correspond to any slot in mUiccSlots. This logic is still safe in that case because
            // SlotStatus is only for HAL >= 1.2
            for (int i = 0; i < status.size(); i++) {
            for (int i = 0; i < numSlots; i++) {
                if (mUiccSlots[i].isEuicc()) {
                    String eid = status.get(i).eid;
                    if (!TextUtils.isEmpty(eid)) {