From e14af0e26eb11d0a9e4620a75aadcc4b40885aa8 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Mon, 8 Jun 2009 22:59:41 -0700 Subject: [PATCH] Add RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING & reportStkServiceIsRunning. These are used to notify the vendor ril that the StkService is running and ready to receive RIL_UNSOL_STK_XXX commands. --- .../internal/telephony/CommandsInterface.java | 8 ++++++++ .../java/com/android/internal/telephony/RIL.java | 12 ++++++++++++ .../com/android/internal/telephony/RILConstants.java | 1 + .../internal/telephony/gsm/stk/StkService.java | 7 +++---- .../internal/telephony/test/SimulatedCommands.java | 4 ++++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/telephony/java/com/android/internal/telephony/CommandsInterface.java b/telephony/java/com/android/internal/telephony/CommandsInterface.java index cd53b874c33df..75df9555059e7 100644 --- a/telephony/java/com/android/internal/telephony/CommandsInterface.java +++ b/telephony/java/com/android/internal/telephony/CommandsInterface.java @@ -1157,6 +1157,14 @@ public interface CommandsInterface { */ void reportSmsMemoryStatus(boolean available, Message result); + /** + * Indicates to the vendor ril that StkService is running + * rand is eady to receive RIL_UNSOL_STK_XXXX commands. + * + * @param result callback message + */ + void reportStkServiceIsRunning(Message result); + void invokeOemRilRequestRaw(byte[] data, Message response); void invokeOemRilRequestStrings(String[] strings, Message response); diff --git a/telephony/java/com/android/internal/telephony/RIL.java b/telephony/java/com/android/internal/telephony/RIL.java index e7f0c491d603c..9227f29b14508 100644 --- a/telephony/java/com/android/internal/telephony/RIL.java +++ b/telephony/java/com/android/internal/telephony/RIL.java @@ -1829,6 +1829,17 @@ public final class RIL extends BaseCommands implements CommandsInterface { send(rr); } + /** + * {@inheritDoc} + */ + public void reportStkServiceIsRunning(Message result) { + RILRequest rr = RILRequest.obtain(RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING, result); + + if (RILJ_LOGD) riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); + + send(rr); + } + //***** Private Methods private void sendScreenState(boolean on) { @@ -3121,6 +3132,7 @@ public final class RIL extends BaseCommands implements CommandsInterface { case RIL_REQUEST_SET_SMSC_ADDRESS: return "RIL_REQUEST_SET_SMSC_ADDRESS"; case RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE: return "REQUEST_EXIT_EMERGENCY_CALLBACK_MODE"; case RIL_REQUEST_REPORT_SMS_MEMORY_STATUS: return "RIL_REQUEST_REPORT_SMS_MEMORY_STATUS"; + case RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING: return "RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING"; default: return ""; } } diff --git a/telephony/java/com/android/internal/telephony/RILConstants.java b/telephony/java/com/android/internal/telephony/RILConstants.java index 0e9e2448ac453..b09832b08f143 100644 --- a/telephony/java/com/android/internal/telephony/RILConstants.java +++ b/telephony/java/com/android/internal/telephony/RILConstants.java @@ -220,6 +220,7 @@ cat include/telephony/ril.h | \ int RIL_REQUEST_GET_SMSC_ADDRESS = 100; int RIL_REQUEST_SET_SMSC_ADDRESS = 101; int RIL_REQUEST_REPORT_SMS_MEMORY_STATUS = 102; + int RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103; int RIL_UNSOL_RESPONSE_BASE = 1000; int RIL_UNSOL_RESPONSE_RADIO_STATE_CHANGED = 1000; int RIL_UNSOL_RESPONSE_CALL_STATE_CHANGED = 1001; diff --git a/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java b/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java index 8f0addc3f855c..a4a614121f235 100644 --- a/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java +++ b/telephony/java/com/android/internal/telephony/gsm/stk/StkService.java @@ -25,8 +25,6 @@ import android.os.Message; import com.android.internal.telephony.IccUtils; import com.android.internal.telephony.CommandsInterface; -import com.android.internal.telephony.EncodeException; -import com.android.internal.telephony.GsmAlphabet; import com.android.internal.telephony.gsm.SimCard; import com.android.internal.telephony.gsm.SIMFileHandler; import com.android.internal.telephony.gsm.SIMRecords; @@ -34,8 +32,6 @@ import com.android.internal.telephony.gsm.SIMRecords; import android.util.Config; import java.io.ByteArrayOutputStream; -import java.util.concurrent.BlockingQueue; -import java.util.concurrent.LinkedBlockingQueue; /** * Enumeration for representing the tag value of COMPREHENSION-TLV objects. If @@ -174,6 +170,9 @@ public class StkService extends Handler implements AppInterface { // Register for SIM ready event. mSimRecords.registerForRecordsLoaded(this, MSG_ID_SIM_LOADED, null); + + mCmdIf.reportStkServiceIsRunning(null); + StkLog.d(this, "StkService: is running"); } public void dispose() { diff --git a/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java b/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java index 9fb9be82b4602..ff7004f3f5125 100644 --- a/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java +++ b/telephony/java/com/android/internal/telephony/test/SimulatedCommands.java @@ -1022,6 +1022,10 @@ public final class SimulatedCommands extends BaseCommands unimplemented(result); } + public void reportStkServiceIsRunning(Message result) { + resultSuccess(result, null); + } + private boolean isSimLocked() { if (mSimLockedState != SimLockState.NONE) { return true;