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

Commit 1bcb2767 authored by Chen Xu's avatar Chen Xu Committed by android-build-merger
Browse files

Merge "only update carrierid from updated esim profile if there is no valid id" into qt-dev

am: 918556e1

Change-Id: If19bf2cf09bf7d233335ff76ad822fcc41449c93
parents 6b487a25 918556e1
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -799,6 +799,7 @@ public class SubscriptionInfoUpdater extends Handler {
        for (EuiccProfileInfo embeddedProfile : embeddedProfiles) {
            int index =
                    findSubscriptionInfoForIccid(existingSubscriptions, embeddedProfile.getIccid());
            int prevCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
            int nameSource = SubscriptionManager.NAME_SOURCE_DEFAULT_SOURCE;
            if (index < 0) {
                // No existing entry for this ICCID; create an empty one.
@@ -806,6 +807,7 @@ public class SubscriptionInfoUpdater extends Handler {
                        embeddedProfile.getIccid(), SubscriptionManager.SIM_NOT_INSERTED);
            } else {
                nameSource = existingSubscriptions.get(index).getNameSource();
                prevCarrierId = existingSubscriptions.get(index).getCarrierId();
                existingSubscriptions.remove(index);
            }

@@ -836,8 +838,13 @@ public class SubscriptionInfoUpdater extends Handler {
            values.put(SubscriptionManager.PROFILE_CLASS, embeddedProfile.getProfileClass());
            CarrierIdentifier cid = embeddedProfile.getCarrierIdentifier();
            if (cid != null) {
                // Due to the limited subscription information, carrier id identified here might
                // not be accurate compared with CarrierResolver. Only update carrier id if there
                // is no valid carrier id present.
                if (prevCarrierId == TelephonyManager.UNKNOWN_CARRIER_ID) {
                    values.put(SubscriptionManager.CARRIER_ID,
                            CarrierResolver.getCarrierIdFromIdentifier(mContext, cid));
                }
                String mcc = cid.getMcc();
                String mnc = cid.getMnc();
                values.put(SubscriptionManager.MCC_STRING, mcc);