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

Commit 32e813e3 authored by Preeti Ahuja's avatar Preeti Ahuja
Browse files

Broadcast icc card state as NOT_READY if card is not initialized

When radio turns on, card state (external state ) is updated.
At this point, if the UiccCard instance is null (UiccCard instance could
be null at bootup, before we have received a vaild card state from
UiccController), icc state as ABSENT is broadcasted.

When the card state is being updated, if the UiccCard instance
is null, broadcast the state as NOT_READY instead of ABSENT.

Change-Id: I18ced764a43f77b2df01a09891ef6356d7ac7ed2
parent d20afc9b
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -362,7 +362,6 @@ public class IccCardProxy extends Handler implements IccCard {
                mIccRecords = newRecords;
                registerUiccCardEvents();
            }

            updateExternalState();
        }
    }
@@ -382,7 +381,15 @@ public class IccCardProxy extends Handler implements IccCard {
    }

    private void updateExternalState() {
        if (mUiccCard == null || mUiccCard.getCardState() == CardState.CARDSTATE_ABSENT) {

        // mUiccCard could be null at bootup, before valid card states have
        // been received from UiccController.
        if (mUiccCard == null) {
            setExternalState(State.NOT_READY);
            return;
        }

        if (mUiccCard.getCardState() == CardState.CARDSTATE_ABSENT) {
            if (mRadioOn) {
                setExternalState(State.ABSENT);
            } else {