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

Commit 8df58c74 authored by Pengquan Meng's avatar Pengquan Meng
Browse files

Fixed esim fresh issue

Currently we use SubscriptionInfo.isEmbedded() to check if the
subscription is an euicc subscription. However, this bit is set
after we called
SubscriptionInfoUpdater.updateEmbeddedSubscriptions(cardId), there is a
circular dependency.

So we use the uiccSlots to get all euicc cardId and refresh the euicc
subscription for these euicc card.

Bug: 121194788
Test: build
Change-Id: I174b1ce11892d99fcb0446f9985a530a30989701
parent 41ea32b8
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -59,8 +59,8 @@ import com.android.internal.telephony.uicc.UiccSlot;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

/**
 *@hide
@@ -702,13 +702,13 @@ public class SubscriptionInfoUpdater extends Handler {
                mSubscriptionManager.getDefaultDataSubscriptionId());

        // No need to check return value here as we notify for the above changes anyway.
        if (subInfos != null) {
        UiccController uiccController = UiccController.getInstance();
            subInfos.stream()
                    .filter(subInfo -> subInfo.isEmbedded())
                    .mapToInt(subInfo -> subInfo.getCardId())
                    .mapToObj(cardId -> cardId)
                    .collect(Collectors.toSet())
        UiccSlot[] uiccSlots = uiccController.getUiccSlots();
        if (uiccSlots != null) {
            Arrays.stream(uiccSlots)
                .filter(uiccSlot -> uiccSlot.isEuicc())
                .map(uiccSlot -> uiccController.convertToPublicCardId(
                            uiccSlot.getUiccCard().getCardId()))
                .forEach(cardId -> updateEmbeddedSubscriptions(cardId));
        }