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

Commit 379cbb1d authored by Kazuhiro Ondo's avatar Kazuhiro Ondo Committed by Wink Saville
Browse files

Send STK Service Running RIL Request after sim module is ready

Currently "STK Service Running" is sent as soon as phone app is
started. And depending on the timing of vendor RIL initialization
the event may not be handled. This patch waits for SIM_READY,
RUIM_READY or NV_READY indicating vendor's SIM (equivalent) module
become ready to process the event.

Change-Id: I4182a5413201f11856989664c8f19ae1eca48e2f
parent 7353301f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -135,6 +135,7 @@ public class CatService extends Handler implements AppInterface {
    static final int MSG_ID_CALL_SETUP               = 4;
    static final int MSG_ID_REFRESH                  = 5;
    static final int MSG_ID_RESPONSE                 = 6;
    static final int MSG_ID_SIM_READY                = 7;

    static final int MSG_ID_RIL_MSG_DECODED          = 10;

@@ -172,9 +173,11 @@ public class CatService extends Handler implements AppInterface {
        mIccRecords = ir;

        // Register for SIM ready event.
        mCmdIf.registerForSIMReady(this, MSG_ID_SIM_READY, null);
        mCmdIf.registerForRUIMReady(this, MSG_ID_SIM_READY, null);
        mCmdIf.registerForNVReady(this, MSG_ID_SIM_READY, null);
        mIccRecords.registerForRecordsLoaded(this, MSG_ID_ICC_RECORDS_LOADED, null);

        mCmdIf.reportStkServiceIsRunning(null);
        CatLog.d(this, "Is running");
    }

@@ -588,6 +591,10 @@ public class CatService extends Handler implements AppInterface {
        case MSG_ID_RESPONSE:
            handleCmdResponse((CatResponseMessage) msg.obj);
            break;
        case MSG_ID_SIM_READY:
            CatLog.d(this, "SIM ready. Reporting STK service running now...");
            mCmdIf.reportStkServiceIsRunning(null);
            break;
        default:
            throw new AssertionError("Unrecognized CAT command: " + msg.what);
        }