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

Commit 0ee68f9d authored by chen xu's avatar chen xu
Browse files

fix the issue that update carrier id to the wrong subId during switch

This happens during profile switch. carrier id identification
logic listens for recordsLoaded which triggered before subId update.
so we updated the new carrier id to the old subId (subId doesnt change
to -1 during profile update). The fix is having a single entry point
to trigger carrier identification which is from subscriptionInfoUpdater
when subId update finished.

Bug: 132978582
Test: Manual
Change-Id: I44cbfa2d8c643f4cc2fe96d5582dec3e7ff45a99
parent 35ad303d
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -131,8 +131,13 @@ public class CarrierResolver extends Handler {
     *  /ACTION_SIM_APPLICATION_STATE_CHANGED
     *  3. ACTION_SUBSCRIPTION_CARRIER_IDENTITY_CHANGED
     *
     *  For SIM refresh either reset or file update, SubscriptionInfoUpdater will re-trigger
     *  carrier identification with sim loaded state.
     *  For SIM refresh either reset or init refresh type, SubscriptionInfoUpdater will re-trigger
     *  carrier identification with sim loaded state. Framework today silently handle single file
     *  refresh type.
     *  TODO: check fileId from single file refresh, if the refresh file is IMSI, gid1 or other
     *  records which might change carrier id, framework should trigger sim loaded state just like
     *  other refresh events: INIT or RESET and which will ultimately trigger carrier
     *  re-identification.
     */
    public void resolveSubscriptionCarrierId(String simState) {
        logd("[resolveSubscriptionCarrierId] simState: " + simState);
@@ -223,13 +228,11 @@ public class CarrierResolver extends Handler {
                if (mIccRecords != newIccRecords) {
                    if (mIccRecords != null) {
                        logd("Removing stale icc objects.");
                        mIccRecords.unregisterForRecordsLoaded(this);
                        mIccRecords.unregisterForRecordsOverride(this);
                        mIccRecords = null;
                    }
                    if (newIccRecords != null) {
                        logd("new Icc object");
                        newIccRecords.registerForRecordsLoaded(this, SIM_LOAD_EVENT, null);
                        newIccRecords.registerForRecordsOverride(this, SIM_LOAD_EVENT, null);
                        mIccRecords = newIccRecords;
                    }