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

Commit 11a93183 authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge "Fix for properly setting SIM lock state."

am: 871bb05c

Change-Id: Ifa094bea747f9b1d0445708fbbfd0d84af8e1a97
parents ed89805b 871bb05c
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() {