Skip to content

Commit

Permalink
added support for STK SEND_SMS proactive command
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksm authored and drakaz committed Jan 6, 2011
1 parent 1081022 commit 2f0eeab
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions libril/ril.cpp
Expand Up @@ -86,7 +86,7 @@ namespace android {
#define PRINTBUF_SIZE 8096

// Enable RILC log
#define RILC_LOG 0
#define RILC_LOG 1

#if RILC_LOG
#define startRequest sprintf(printBuf, "(")
Expand Down Expand Up @@ -2789,16 +2789,22 @@ void RIL_onUnsolicitedResponse(int unsolResponse, void *data,

unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE;

if ((unsolResponseIndex < 0)
|| (unsolResponseIndex >= (int32_t)NUM_ELEMS(s_unsolResponses))) {
//aleksm
if (((unsolResponseIndex < 0)
|| (unsolResponseIndex >= (int32_t)NUM_ELEMS(s_unsolResponses)))
&& unsolResponse != RIL_UNSOL_STK_SEND_SMS_RESULT) {
LOGE("unsupported unsolicited response code %d", unsolResponse);
return;
}

// Grab a wake lock if needed for this reponse,
// as we exit we'll either release it immediately
// or set a timer to release it later.
switch (s_unsolResponses[unsolResponseIndex].wakeType) {

//aleksm
int32_t iLength = (int32_t)NUM_ELEMS(s_unsolResponses);

switch (s_unsolResponses[unsolResponseIndex >= iLength?(iLength-1):unsolResponseIndex].wakeType) {
case WAKE_PARTIAL:
grabPartialWakeLock();
shouldScheduleTimeout = true;
Expand Down Expand Up @@ -2826,7 +2832,8 @@ void RIL_onUnsolicitedResponse(int unsolResponse, void *data,
p.writeInt32 (RESPONSE_UNSOLICITED);
p.writeInt32 (unsolResponse);

ret = s_unsolResponses[unsolResponseIndex]
//AMI
ret = s_unsolResponses[unsolResponseIndex >= iLength?(iLength-1):unsolResponseIndex]
.responseFunction(p, data, datalen);
if (ret != 0) {
// Problem with the response. Don't continue;
Expand Down Expand Up @@ -3125,6 +3132,7 @@ requestToString(int request) {
case RIL_UNSOL_STK_SESSION_END: return "UNSOL_STK_SESSION_END";
case RIL_UNSOL_STK_PROACTIVE_COMMAND: return "UNSOL_STK_PROACTIVE_COMMAND";
case RIL_UNSOL_STK_EVENT_NOTIFY: return "UNSOL_STK_EVENT_NOTIFY";
case RIL_UNSOL_STK_SEND_SMS_RESULT: return "UNSOL_STK_SEND_SMS_RESULT";
case RIL_UNSOL_STK_CALL_SETUP: return "UNSOL_STK_CALL_SETUP";
case RIL_UNSOL_SIM_SMS_STORAGE_FULL: return "UNSOL_SIM_SMS_STORAGE_FUL";
case RIL_UNSOL_SIM_REFRESH: return "UNSOL_SIM_REFRESH";
Expand Down

0 comments on commit 2f0eeab

Please sign in to comment.