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

Commit 2a62a3fd authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Cat: Report stkIsRunning after StkAppService is ready."

parents 2f1d998d d3e25f55
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -65,6 +65,12 @@ public interface AppInterface {
     */
    void onCmdResponse(CatResponseMessage resMsg);

    /*
     * Callback function from app to telephony when the app is ready, that is, the app is up
     * and running and is ready to process commands received from telephony.
     */
    void onStkAppReady();

    /*
     * Enumeration for representing "Type of Command" of proactive commands.
     * Those are the only commands which are supported by the Telephony. Any app
+18 −3
Original line number Diff line number Diff line
@@ -91,6 +91,7 @@ public class CatService extends Handler implements AppInterface {

    protected RilMessageDecoder mMsgDecoder = null;
    protected boolean mStkAppInstalled = false;
    protected boolean mIsStkAppReady = false;

    protected UiccController mUiccController;
    protected CardState mCardState = CardState.CARDSTATE_ABSENT;
@@ -865,6 +866,14 @@ public class CatService extends Handler implements AppInterface {
        mContext.sendBroadcast(intent);
    }

    protected void reportStkIsRunning() {
        CatLog.d(this, "mCardState = " + mCardState +
                " mIsStkAppReady = " + mIsStkAppReady);
        if ((mCardState == CardState.CARDSTATE_PRESENT) && (mIsStkAppReady == true)) {
            mCmdIf.reportStkServiceIsRunning(null);
        }
    }

    @Override
    public synchronized void onCmdResponse(CatResponseMessage resMsg) {
        if (resMsg == null) {
@@ -875,6 +884,13 @@ public class CatService extends Handler implements AppInterface {
        msg.sendToTarget();
    }

    @Override
    public void onStkAppReady(){
        CatLog.d(this, "StkAppReady notification received");
        mIsStkAppReady = true;
        reportStkIsRunning();
    }

    private boolean validateResponse(CatResponseMessage resMsg) {
        boolean validResponse = false;
        if ((resMsg.mCmdDet.typeOfCommand == CommandType.SET_UP_EVENT_LIST.value())
@@ -1047,9 +1063,8 @@ public class CatService extends Handler implements AppInterface {
            broadcastCardStateAndIccRefreshResp(newState, null);
        } else if (oldState != CardState.CARDSTATE_PRESENT &&
                newState == CardState.CARDSTATE_PRESENT) {
            // Card moved to PRESENT STATE.
            mCmdIf.reportStkServiceIsRunning(null);
            // Card moved to PRESENT STATE
            reportStkIsRunning();
        }

    }
}