#define appendPrintBuf(x...)
#endif
+#define MAX_RIL_SOL RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
+#define MAX_RIL_UNSOL RIL_UNSOL_CELL_INFO_LIST
+
enum WakeType {DONT_WAKE, WAKE_PARTIAL};
typedef struct {
/* Hack to include Samsung requests */
if (request > 10000) {
- index = request - 10000 + RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE;
- RLOGE("SAMSUNG: request=%d, index=%d", request, index);
+ index = request - 10000 + MAX_RIL_SOL;
+ RLOGD("SAMSUNG: request=%d, index=%d", request, index);
pRI->pCI = &(s_commands[index]);
} else {
pRI->pCI = &(s_commands[request]);
s_callbacks.onRequest(request, data, len, pRI);
}
-
-
static int
processCommandBuffer(void *buffer, size_t buflen) {
Parcel p;
}
/* Hack to include Samsung requests */
- //if (request < 1 || request >= (int32_t)NUM_ELEMS(s_commands)) {
- if (request < 1 || ((request > RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE) && (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) {
RLOGE("unsupported request code %d token %d", request, token);
// FIXME this should perhaps return a response
return 0;
/* Hack to include Samsung requests */
if (request > 10000) {
- index = request - 10000 + RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE;
- RLOGE("processCommandBuffer: samsung request=%d, index=%d", request, index);
+ index = request - 10000 + MAX_RIL_SOL;
+ RLOGD("processCommandBuffer: samsung request=%d, index=%d",
+ request, index);
pRI->pCI = &(s_commands[index]);
} else {
pRI->pCI = &(s_commands[request]);
startResponse;
for (int i = 0 ; i < numInts ; i++) {
if (i == 0 && p_int[0] == 7) {
- RLOGE("REQUEST_GET_PREFERRED_NETWORK_TYPE: NETWORK_MODE_GLOBAL => NETWORK_MODE_WCDMA_PREF");
+ RLOGD("REQUEST_GET_PREFERRED_NETWORK_TYPE: NETWORK_MODE_GLOBAL => NETWORK_MODE_WCDMA_PREF");
p_int[0] = 0;
}
appendPrintBuf("%s%d,", printBuf, p_int[i]);
p.writeInt32 (0);
} else {
char **p_cur = (char **) response;
+ int j = 0;
numStrings = responselen / sizeof(char *);
p.writeInt32 ((numStrings / inQANElements) * outQANElements);
/* each string*/
startResponse;
- int j=0;
for (int i = 0 ; i < numStrings ; i++) {
/* Samsung is sending 5 elements, upper layer expects 4.
Drop every 5th element here */
if (j == outQANElements) {
- j=0;
+ j = 0;
} else {
appendPrintBuf("%s%s,", printBuf, (char*)p_cur[i]);
writeStringToParcel (p, p_cur[i]);
}
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
RLOGW("RIL_onUnsolicitedResponse called before RIL_register");
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;
+ RLOGD("SAMSUNG: unsolResponse=%d, unsolResponseIndex=%d", unsolResponse, unsolResponseIndex);
+ } else {
+ unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE;
+ }
if ((unsolResponseIndex < 0)
|| (unsolResponseIndex >= (int32_t)NUM_ELEMS(s_unsolResponses))) {
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_CELL_INFO_LIST: return "UNSOL_CELL_INFO_LIST";
+ case RIL_UNSOL_STK_SEND_SMS_RESULT: return "RIL_UNSOL_STK_SEND_SMS_RESULT";
default: return "<unknown request>";
}
}
{RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE, responseVoid, WAKE_PARTIAL},
{RIL_UNSOL_RIL_CONNECTED, responseInts, WAKE_PARTIAL},
{RIL_UNSOL_VOICE_RADIO_TECH_CHANGED, responseInts, WAKE_PARTIAL},
- {RIL_UNSOL_CELL_INFO_LIST, responseCellInfoList, WAKE_PARTIAL},
+ {RIL_UNSOL_CELL_INFO_LIST, responseCellInfoList, WAKE_PARTIAL}, // 1036
+ {RIL_UNSOL_RELEASE_COMPLETE_MESSAGE, responseVoid, WAKE_PARTIAL}, // 11001
+ {RIL_UNSOL_STK_SEND_SMS_RESULT, responseInts, WAKE_PARTIAL}, // 11002
#define appendPrintBuf(x...)
#endif
+#define MAX_RIL_SOL RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
+#define MAX_RIL_UNSOL RIL_UNSOL_CELL_INFO_LIST
+
enum WakeType {DONT_WAKE, WAKE_PARTIAL};
typedef struct {
/* Hack to include Samsung requests */
if (request > 10000) {
- index = request - 10000 + RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE;
+ index = request - 10000 + MAX_RIL_SOL;
RLOGD("SAMSUNG: request=%d, index=%d", request, index);
pRI->pCI = &(s_commands[index]);
} else {
}
/* Hack to include Samsung requests */
- if (request < 1 || ((request > RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE) &&
+ if (request < 1 || ((request > MAX_RIL_SOL) &&
(request < RIL_REQUEST_GET_CELL_BROADCAST_CONFIG)) ||
request > RIL_REQUEST_HANGUP_VT) {
RLOGE("unsupported request code %d token %d", request, token);
/* Hack to include Samsung requests */
if (request > 10000) {
- index = request - 10000 + RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE;
+ index = request - 10000 + MAX_RIL_SOL;
RLOGD("processCommandBuffer: samsung request=%d, index=%d",
request, index);
pRI->pCI = &(s_commands[index]);
}
if (responselen % sizeof(int) != 0) {
RLOGE("invalid response length %d expected multiple of %d\n",
- (int)responselen, (int)sizeof(int));
+ (int)responselen, (int)sizeof(int));
return RIL_ERRNO_INVALID_RESPONSE;
}
}
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
RLOGW("RIL_onUnsolicitedResponse called before RIL_register");
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;
+ RLOGD("SAMSUNG: unsolResponse=%d, unsolResponseIndex=%d", unsolResponse, unsolResponseIndex);
+ } else {
+ unsolResponseIndex = unsolResponse - RIL_UNSOL_RESPONSE_BASE;
+ }
if ((unsolResponseIndex < 0)
|| (unsolResponseIndex >= (int32_t)NUM_ELEMS(s_unsolResponses))) {
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_CELL_INFO_LIST: return "UNSOL_CELL_INFO_LIST";
+ case RIL_UNSOL_STK_SEND_SMS_RESULT: return "RIL_UNSOL_STK_SEND_SMS_RESULT";
default: return "<unknown request>";
}
}
{RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS, dispatchString, responseSIM_IO},
{RIL_REQUEST_VOICE_RADIO_TECH, dispatchVoiceRadioTech, responseInts},
{RIL_REQUEST_GET_CELL_INFO_LIST, dispatchVoid, responseCellInfoList},
- {RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE, dispatchInts, responseVoid},
+ {RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE, dispatchInts, responseVoid}, // 110
{0, NULL, NULL}, // 10001
{RIL_REQUEST_GET_CELL_BROADCAST_CONFIG, dispatchVoid, responseVoid},
{0, NULL, NULL}, // 10003
{RIL_UNSOL_EXIT_EMERGENCY_CALLBACK_MODE, responseVoid, WAKE_PARTIAL},
{RIL_UNSOL_RIL_CONNECTED, responseInts, WAKE_PARTIAL},
{RIL_UNSOL_VOICE_RADIO_TECH_CHANGED, responseInts, WAKE_PARTIAL},
- {RIL_UNSOL_CELL_INFO_LIST, responseCellInfoList, WAKE_PARTIAL},
+ {RIL_UNSOL_CELL_INFO_LIST, responseCellInfoList, WAKE_PARTIAL}, // 1036
+ {RIL_UNSOL_RELEASE_COMPLETE_MESSAGE, responseVoid, WAKE_PARTIAL}, // 11001
+ {RIL_UNSOL_STK_SEND_SMS_RESULT, responseInts, WAKE_PARTIAL}, // 11002