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

Commit b475e639 authored by Pengquan Meng's avatar Pengquan Meng Committed by Gerrit Code Review
Browse files

Merge "Fixed subscriptionInfoUpdater crash"

parents 4736e3b6 7235958d
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -208,8 +208,15 @@ public class SubscriptionInfoUpdater extends Handler {
    @UnsupportedAppUsage
    @UnsupportedAppUsage
    private boolean isAllIccIdQueryDone() {
    private boolean isAllIccIdQueryDone() {
        for (int i = 0; i < PROJECT_SIM_NUM; i++) {
        for (int i = 0; i < PROJECT_SIM_NUM; i++) {
            UiccSlot slot = UiccController.getInstance().getUiccSlotForPhone(i);
            int slotId = UiccController.getInstance().getSlotIdFromPhoneId(i);
            if  (mIccId[i] == null || slot == null || !slot.isActive()) {
                if (mIccId[i] == null) {
                if (mIccId[i] == null) {
                logd("Wait for SIM" + (i + 1) + " IccId");
                    logd("Wait for SIM " + i + " Iccid");
                } else {
                    logd(String.format("Wait for slot corresponding to phone %d to be active, "
                            + "slotId is %d", i, slotId));
                }
                return false;
                return false;
            }
            }
        }
        }
@@ -617,7 +624,7 @@ public class SubscriptionInfoUpdater extends Handler {
            UiccSlot[] uiccSlots = uiccController.getUiccSlots();
            UiccSlot[] uiccSlots = uiccController.getUiccSlots();
            if (uiccSlots != null) {
            if (uiccSlots != null) {
                Arrays.stream(uiccSlots)
                Arrays.stream(uiccSlots)
                        .filter(uiccSlot -> uiccSlot.getUiccCard() != null)
                        .filter(uiccSlot -> uiccSlot != null && uiccSlot.getUiccCard() != null)
                        .map(uiccSlot -> uiccController.convertToPublicCardId(
                        .map(uiccSlot -> uiccController.convertToPublicCardId(
                                uiccSlot.getUiccCard().getCardId()))
                                uiccSlot.getUiccCard().getCardId()))
                        .forEach(cardId -> updateEmbeddedSubscriptions(cardId));
                        .forEach(cardId -> updateEmbeddedSubscriptions(cardId));
+1 −1
Original line number Original line Diff line number Diff line
@@ -158,7 +158,7 @@ public class EuiccCardController extends IEuiccCardController.Stub {
        }
        }
        for (int i = 0; i < slots.length; ++i) {
        for (int i = 0; i < slots.length; ++i) {
            UiccSlot slotInfo = slots[i];
            UiccSlot slotInfo = slots[i];
            if (!slotInfo.isRemovable() && slotInfo.isActive()) {
            if (slotInfo != null && !slotInfo.isRemovable() && slotInfo.isActive()) {
                return true;
                return true;
            }
            }
        }
        }