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

Commit 1973cfad 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...

Merge "only update carrierid from updated esim profile if there is no valid id" into qt-dev am: 918556e1
am: 1bcb2767

Change-Id: I05aa430025482271126aab7ea4b0fbf59c91fb31
parents f5c2bbd9 1bcb2767
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);