From 379cbb1dcc4f9c7f4ca485bc34ec056e87456c8d Mon Sep 17 00:00:00 2001 From: Kazuhiro Ondo Date: Tue, 26 Apr 2011 18:54:56 -0500 Subject: [PATCH] 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 --- .../com/android/internal/telephony/cat/CatService.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/telephony/java/com/android/internal/telephony/cat/CatService.java b/telephony/java/com/android/internal/telephony/cat/CatService.java index a6c7777f56967..2f3b1772b1ed4 100644 --- a/telephony/java/com/android/internal/telephony/cat/CatService.java +++ b/telephony/java/com/android/internal/telephony/cat/CatService.java @@ -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); }