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

Commit e200adbf authored by Amit Mahajan's avatar Amit Mahajan
Browse files

Fix for properly setting SIM lock state.

Test: verified SIM locking/unlocking with a TMo SIM
Bug: 72513243
Merged-in: Ieffa067d2ea0e23c929d71cf4d854f6ea07e124a
Change-Id: Ieffa067d2ea0e23c929d71cf4d854f6ea07e124a
parent 97742aa6
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
@@ -232,7 +232,13 @@ public class UiccProfile extends Handler implements IccCard {

            case EVENT_APP_READY:
                if (VDBG) log("EVENT_APP_READY");
                setExternalStateOnReady();
                if (areAllApplicationsReady()) {
                    if (areAllRecordsLoaded() && areCarrierPriviligeRulesLoaded()) {
                        setExternalState(IccCardConstants.State.LOADED);
                    } else {
                        setExternalState(IccCardConstants.State.READY);
                    }
                }
                break;

            case EVENT_RECORDS_LOADED:
@@ -282,7 +288,9 @@ public class UiccProfile extends Handler implements IccCard {
            case EVENT_CARRIER_PRIVILEGES_LOADED:
                if (VDBG) log("EVENT_CARRIER_PRIVILEGES_LOADED");
                onCarrierPriviligesLoadedMessage();
                if (areAllRecordsLoaded()) {
                    setExternalState(IccCardConstants.State.LOADED);
                }
                break;

            case EVENT_OPEN_LOGICAL_CHANNEL_DONE:
@@ -379,12 +387,6 @@ public class UiccProfile extends Handler implements IccCard {
                // Otherwise don't change external SIM state.
                break;
            case APPSTATE_READY:
                setExternalStateOnReady();
                break;
        }
    }

    private void setExternalStateOnReady() {
                if (areAllApplicationsReady()) {
                    if (areAllRecordsLoaded() && areCarrierPriviligeRulesLoaded()) {
                        setExternalState(IccCardConstants.State.LOADED);
@@ -394,6 +396,8 @@ public class UiccProfile extends Handler implements IccCard {
                } else {
                    setExternalState(IccCardConstants.State.NOT_READY);
                }
                break;
        }
    }

    private void registerAllAppEvents() {