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

Commit 66be3d99 authored by Jordan Liu's avatar Jordan Liu Committed by android-build-merger
Browse files

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

am: 140e9cd2

Change-Id: Ic384c46ab11c1762724384f94a177eb176494ea4
parents 7ee4fab3 140e9cd2
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -393,6 +393,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");
@@ -477,16 +478,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) {