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

Commit 283079a8 authored by Li Wei's avatar Li Wei Committed by Gerrit - the friendly Code Review server
Browse files

Telephony: Fix force close issue

- mContext in SIMRecords class inherits from parent class
  IccRecords become null resulting in NPE issue when SIM
  cards removed/disposed;
- Add null check for mContext in getDisplayRule() of class
  SIMRecords.

Change-Id: I530dc7b09e96359a93d46d95f421bc3a8b1d2ea2
CRs-Fixed: 1057570
parent 7d0fa830
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1628,7 +1628,7 @@ public class SIMRecords extends IccRecords {
    @Override
    public int getDisplayRule(String plmn) {
        int rule;

        if (mContext != null) {
            CarrierConfigManager configLoader = (CarrierConfigManager)
                     mContext.getSystemService(Context.CARRIER_CONFIG_SERVICE);
            if (configLoader != null && configLoader.getConfig().getBoolean(
@@ -1637,7 +1637,7 @@ public class SIMRecords extends IccRecords {
                if (DBG) log("Set mSpnDisplayCondition to 0 for SPN override");
                mSpnDisplayCondition = 0;
            }

        }
        if (mParentApp != null && mParentApp.getUiccCard() != null &&
            mParentApp.getUiccCard().getOperatorBrandOverride() != null) {
        // If the operator has been overridden, treat it as the SPN file on the SIM did not exist.