diff options
Diffstat (limited to 'ril/xmm6262/libril/ril.cpp')
-rw-r--r-- | ril/xmm6262/libril/ril.cpp | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/ril/xmm6262/libril/ril.cpp b/ril/xmm6262/libril/ril.cpp index 933f6ee..f30520f 100644 --- a/ril/xmm6262/libril/ril.cpp +++ b/ril/xmm6262/libril/ril.cpp @@ -113,6 +113,9 @@ namespace android { #define appendPrintBuf(x...) #endif +#define MAX_RIL_SOL RIL_REQUEST_VOICE_RADIO_TECH +#define MAX_RIL_UNSOL RIL_UNSOL_VOICE_RADIO_TECH_CHANGED + enum WakeType {DONT_WAKE, WAKE_PARTIAL}; typedef struct { @@ -334,8 +337,8 @@ issueLocalRequest(int request, void *data, int len) { /* Hack to include Samsung requests */ if (request > 10000) { - index = request - 10000 + RIL_REQUEST_VOICE_RADIO_TECH; - ALOGE("SAMSUNG: request=%d, index=%d", request, index); + index = request - 10000 + MAX_RIL_SOL; + ALOGD("SAMSUNG: request=%d, index=%d", request, index); pRI->pCI = &(s_commands[index]); } else { pRI->pCI = &(s_commands[request]); @@ -377,8 +380,9 @@ processCommandBuffer(void *buffer, size_t buflen) { } /* Hack to include Samsung requests */ - //if (request < 1 || request >= (int32_t)NUM_ELEMS(s_commands)) { - if (request < 1 || ((request > RIL_REQUEST_VOICE_RADIO_TECH) && (request < RIL_REQUEST_GET_CELL_BROADCAST_CONFIG)) || request > RIL_REQUEST_HANGUP_VT) { + if (request < 1 || ((request > MAX_RIL_SOL) && + (request < RIL_REQUEST_GET_CELL_BROADCAST_CONFIG)) || + request > RIL_REQUEST_HANGUP_VT) { ALOGE("unsupported request code %d token %d", request, token); // FIXME this should perhaps return a response return 0; @@ -390,8 +394,9 @@ processCommandBuffer(void *buffer, size_t buflen) { /* Hack to include Samsung requests */ if (request > 10000) { - index = request - 10000 + RIL_REQUEST_VOICE_RADIO_TECH; - ALOGE("processCommandBuffer: samsung request=%d, index=%d", request, index); + index = request - 10000 + MAX_RIL_SOL; + ALOGD("processCommandBuffer: samsung request=%d, index=%d", + request, index); pRI->pCI = &(s_commands[index]); } else { pRI->pCI = &(s_commands[request]); @@ -2962,8 +2967,14 @@ RIL_register (const RIL_RadioFunctions *callbacks) { } for (int i = 0; i < (int)NUM_ELEMS(s_unsolResponses); i++) { - assert(i + RIL_UNSOL_RESPONSE_BASE + /* Hack to include Samsung responses */ + if (i > MAX_RIL_UNSOL - RIL_UNSOL_RESPONSE_BASE) { + assert(i + SAMSUNG_UNSOL_RESPONSE_BASE - MAX_RIL_UNSOL + == s_unsolResponses[i].requestNumber); + } else { + assert(i + RIL_UNSOL_RESPONSE_BASE == s_unsolResponses[i].requestNumber); + } } // New rild impl calls RIL_startEventLoop() first @@ -3278,7 +3289,13 @@ void RIL_onUnsolicitedResponse(int unsolResponse, void *data, return; } - unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE; + /* Hack to include Samsung responses */ + if (unsolResponse > SAMSUNG_UNSOL_RESPONSE_BASE) { + unsolResponseIndex = unsolResponse - SAMSUNG_UNSOL_RESPONSE_BASE + MAX_RIL_UNSOL - RIL_UNSOL_RESPONSE_BASE; + ALOGD("SAMSUNG: unsolResponse=%d, unsolResponseIndex=%d", unsolResponse, unsolResponseIndex); + } else { + unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE; + } if ((unsolResponseIndex < 0) || (unsolResponseIndex >= (int32_t)NUM_ELEMS(s_unsolResponses))) { @@ -3632,6 +3649,7 @@ requestToString(int request) { case RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE: return "UNSOL_EXIT_EMERGENCY_CALLBACK_MODE"; case RIL_UNSOL_RIL_CONNECTED: return "UNSOL_RIL_CONNECTED"; case RIL_UNSOL_VOICE_RADIO_TECH_CHANGED: return "UNSOL_VOICE_RADIO_TECH_CHANGED"; + case RIL_UNSOL_STK_SEND_SMS_RESULT: return "RIL_UNSOL_STK_SEND_SMS_RESULT"; default: return "<unknown request>"; } } |