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

Commit f7daa66e 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: 5ff0137a

Change-Id: If696b7cec5b60d6635c37af0c704504948886e80
parents f5c2bbd9 5ff0137a
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);