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

Commit 7ed278ac authored by Daniel Bright's avatar Daniel Bright
Browse files

Skip notifying network locked registrants if UiccApp==null

Skipping mNetworkLockedRegistrants.notifyRegistrants if mUiccApplication is NULL to prevent
NULL exception.  External State is called on the fall through.

Bug: 157451571
Test: UiccProfileTest
Change-Id: I4e21234e3c10ec02adc9388e2ecddfda34ca8493
parent 00754008
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -197,8 +197,13 @@ public class UiccProfile extends IccCard {
            logWithLocalLog("handleMessage: Received " + eventName + " for phoneId " + mPhoneId);
            switch (msg.what) {
                case EVENT_NETWORK_LOCKED:
                    if (mUiccApplication != null) {
                        mNetworkLockedRegistrants.notifyRegistrants(new AsyncResult(
                                null, mUiccApplication.getPersoSubState().ordinal(), null));
                    } else {
                        log("EVENT_NETWORK_LOCKED: mUiccApplication is NULL, "
                                + "mNetworkLockedRegistrants not notified.");
                    }
                    // intentional fall through
                case EVENT_RADIO_OFF_OR_UNAVAILABLE:
                case EVENT_ICC_LOCKED:
@@ -771,8 +776,15 @@ public class UiccProfile extends IccCard {
            mNetworkLockedRegistrants.add(r);

            if (getState() == IccCardConstants.State.NETWORK_LOCKED) {
                if (mUiccApplication != null) {
                    r.notifyRegistrant(
                        new AsyncResult(null, mUiccApplication.getPersoSubState().ordinal(), null));
                            new AsyncResult(null, mUiccApplication.getPersoSubState().ordinal(),
                                    null));

                } else {
                    log("registerForNetworkLocked: not notifying registrants, "
                            + "mUiccApplication == null");
                }
            }
        }
    }