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

Commit 140e9cd2 authored by Jordan Liu's avatar Jordan Liu Committed by Gerrit Code Review
Browse files

Merge "MSIM:Fix sim state change intent broadcasted for both slots."

parents 09422470 71c7fa3b
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -356,6 +356,7 @@ public class SubscriptionInfoUpdater extends Handler {
        // The SIM should be loaded at this state, but it is possible in cases such as SIM being
        // removed or a refresh RESET that the IccRecords could be null. The right behavior is to
        // not broadcast the SIM loaded.
        int loadedSlotId = slotId;
        IccRecords records = mPhone[slotId].getIccCard().getIccRecords();
        if (records == null) {  // Possibly a race condition.
            logd("handleSimLoaded: IccRecords null");
@@ -440,16 +441,16 @@ public class SubscriptionInfoUpdater extends Handler {
                    editor.putInt(CURR_SUBID + slotId, subId);
                    editor.apply();
                }
            }
        }

        // Update set of enabled carrier apps now that the privilege rules may have changed.
        CarrierAppUtils.disableCarrierAppsUntilPrivileged(mContext.getOpPackageName(),
                mPackageManager, TelephonyManager.getDefault(),
                mContext.getContentResolver(), mCurrentlyActiveUserId);

                broadcastSimStateChanged(slotId, IccCardConstants.INTENT_VALUE_ICC_LOADED, null);
                updateCarrierServices(slotId, IccCardConstants.INTENT_VALUE_ICC_LOADED);
            }
        }
        broadcastSimStateChanged(loadedSlotId, IccCardConstants.INTENT_VALUE_ICC_LOADED, null);
        updateCarrierServices(loadedSlotId, IccCardConstants.INTENT_VALUE_ICC_LOADED);
    }

    private void updateCarrierServices(int slotId, String simState) {