summaryrefslogtreecommitdiffstats
path: root/libril/ril.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libril/ril.cpp')
-rw-r--r--libril/ril.cpp80
1 files changed, 66 insertions, 14 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp
index 0f244c3..a1105b4 100644
--- a/libril/ril.cpp
+++ b/libril/ril.cpp
@@ -2410,36 +2410,86 @@ static int responseDataCallListV6(Parcel &p, void *response, size_t responselen)
return 0;
}
+static int responseDataCallListV9(Parcel &p, void *response, size_t responselen)
+{
+ if (response == NULL && responselen != 0) {
+ RLOGE("invalid response: NULL");
+ return RIL_ERRNO_INVALID_RESPONSE;
+ }
+
+ if (responselen % sizeof(RIL_Data_Call_Response_v9) != 0) {
+ RLOGE("responseDataCallListV9: invalid response length %d expected multiple of %d",
+ (int)responselen, (int)sizeof(RIL_Data_Call_Response_v9));
+ return RIL_ERRNO_INVALID_RESPONSE;
+ }
+
+ // Write version
+ p.writeInt32(10);
+
+ int num = responselen / sizeof(RIL_Data_Call_Response_v9);
+ p.writeInt32(num);
+
+ RIL_Data_Call_Response_v9 *p_cur = (RIL_Data_Call_Response_v9 *) response;
+ startResponse;
+ int i;
+ for (i = 0; i < num; i++) {
+ p.writeInt32((int)p_cur[i].status);
+ p.writeInt32(p_cur[i].suggestedRetryTime);
+ p.writeInt32(p_cur[i].cid);
+ p.writeInt32(p_cur[i].active);
+ writeStringToParcel(p, p_cur[i].type);
+ writeStringToParcel(p, p_cur[i].ifname);
+ writeStringToParcel(p, p_cur[i].addresses);
+ writeStringToParcel(p, p_cur[i].dnses);
+ writeStringToParcel(p, p_cur[i].gateways);
+ writeStringToParcel(p, p_cur[i].pcscf);
+ appendPrintBuf("%s[status=%d,retry=%d,cid=%d,%s,%s,%s,%s,%s,%s,%s],", printBuf,
+ p_cur[i].status,
+ p_cur[i].suggestedRetryTime,
+ p_cur[i].cid,
+ (p_cur[i].active==0)?"down":"up",
+ (char*)p_cur[i].type,
+ (char*)p_cur[i].ifname,
+ (char*)p_cur[i].addresses,
+ (char*)p_cur[i].dnses,
+ (char*)p_cur[i].gateways,
+ (char*)p_cur[i].pcscf);
+ }
+ removeLastChar;
+ closeResponse;
+
+ return 0;
+}
+
+
static int responseDataCallList(Parcel &p, void *response, size_t responselen)
{
if (s_callbacks.version < 5) {
RLOGD("responseDataCallList: v4");
return responseDataCallListV4(p, response, responselen);
+ } else if (responselen % sizeof(RIL_Data_Call_Response_v6) == 0) {
+ return responseDataCallListV6(p, response, responselen);
+ } else if (responselen % sizeof(RIL_Data_Call_Response_v9) == 0) {
+ return responseDataCallListV9(p, response, responselen);
} else {
if (response == NULL && responselen != 0) {
RLOGE("invalid response: NULL");
return RIL_ERRNO_INVALID_RESPONSE;
}
- // Support v6 or v9 with new rils
- if (responselen % sizeof(RIL_Data_Call_Response_v6) == 0) {
- RLOGD("responseDataCallList: v6");
- return responseDataCallListV6(p, response, responselen);
- }
-
- if (responselen % sizeof(RIL_Data_Call_Response_v9) != 0) {
- RLOGE("responseDataCallList: invalid response length %d expected multiple of %d",
- (int)responselen, (int)sizeof(RIL_Data_Call_Response_v9));
+ if (responselen % sizeof(RIL_Data_Call_Response_v11) != 0) {
+ RLOGE("invalid response length %d expected multiple of %d",
+ (int)responselen, (int)sizeof(RIL_Data_Call_Response_v11));
return RIL_ERRNO_INVALID_RESPONSE;
}
// Write version
- p.writeInt32(10);
+ p.writeInt32(11);
- int num = responselen / sizeof(RIL_Data_Call_Response_v9);
+ int num = responselen / sizeof(RIL_Data_Call_Response_v11);
p.writeInt32(num);
- RIL_Data_Call_Response_v9 *p_cur = (RIL_Data_Call_Response_v9 *) response;
+ RIL_Data_Call_Response_v11 *p_cur = (RIL_Data_Call_Response_v11 *) response;
startResponse;
int i;
for (i = 0; i < num; i++) {
@@ -2453,7 +2503,8 @@ static int responseDataCallList(Parcel &p, void *response, size_t responselen)
writeStringToParcel(p, p_cur[i].dnses);
writeStringToParcel(p, p_cur[i].gateways);
writeStringToParcel(p, p_cur[i].pcscf);
- appendPrintBuf("%s[status=%d,retry=%d,cid=%d,%s,%s,%s,%s,%s,%s,%s],", printBuf,
+ p.writeInt32(p_cur[i].mtu);
+ appendPrintBuf("%s[status=%d,retry=%d,cid=%d,%s,%s,%s,%s,%s,%s,%s,mtu=%d],", printBuf,
p_cur[i].status,
p_cur[i].suggestedRetryTime,
p_cur[i].cid,
@@ -2463,7 +2514,8 @@ static int responseDataCallList(Parcel &p, void *response, size_t responselen)
(char*)p_cur[i].addresses,
(char*)p_cur[i].dnses,
(char*)p_cur[i].gateways,
- (char*)p_cur[i].pcscf);
+ (char*)p_cur[i].pcscf,
+ p_cur[i].mtu);
}
removeLastChar;
closeResponse;