summaryrefslogtreecommitdiffstats
path: root/ril/xmm6260/libril/ril.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ril/xmm6260/libril/ril.cpp')
-rwxr-xr-xril/xmm6260/libril/ril.cpp34
1 files changed, 26 insertions, 8 deletions
diff --git a/ril/xmm6260/libril/ril.cpp b/ril/xmm6260/libril/ril.cpp
index 92b896c..ddac68b 100755
--- a/ril/xmm6260/libril/ril.cpp
+++ b/ril/xmm6260/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 {
@@ -330,8 +333,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]);
@@ -373,8 +376,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;
@@ -386,8 +390,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]);
@@ -2814,8 +2819,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
@@ -3130,7 +3141,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))) {
@@ -3484,6 +3501,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>";
}
}