aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZiyan <jaraidaniel@gmail.com>2016-09-09 11:38:47 +0200
committerAndreas Blaesius <skate4life@gmx.de>2016-09-25 18:54:53 +0200
commit31330a5ba4767b53e4051c47ddf61eafde91a7f3 (patch)
tree42b0fdb6c0ea39c90b2c7b0036090b409083e8ec
parent88c9ecb32840656b48a43dd6f81aa637b304c7bb (diff)
downloaddevice_samsung_espresso3g-31330a5ba4767b53e4051c47ddf61eafde91a7f3.tar.gz
device_samsung_espresso3g-31330a5ba4767b53e4051c47ddf61eafde91a7f3.tar.bz2
device_samsung_espresso3g-31330a5ba4767b53e4051c47ddf61eafde91a7f3.zip
libsecril-shim: fix RIL_(REQUEST/UNSOL)_DATA_CALL_LIST / RIL_REQUEST_SETUP_DATA_CALL
According to the Samsung RIL, the addresses are the gateways? This fixes mobile data. Change-Id: I95937fcdc1b5991a1361d052cdcba220f1fd8758
-rw-r--r--rilsrc/libsecril-shim/secril-shim.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/rilsrc/libsecril-shim/secril-shim.c b/rilsrc/libsecril-shim/secril-shim.c
index 4ddb21c..5e8111e 100644
--- a/rilsrc/libsecril-shim/secril-shim.c
+++ b/rilsrc/libsecril-shim/secril-shim.c
@@ -59,6 +59,15 @@ static void onRequestShim(int request, void *data, size_t datalen, RIL_Token t)
origRilFunctions->onRequest(request, data, datalen, t);
}
+static void fixupDataCallList(void *response, size_t responselen) {
+ RIL_Data_Call_Response_v6 *p_cur = (RIL_Data_Call_Response_v6 *) response;
+ int num = responselen / sizeof(RIL_Data_Call_Response_v6);
+
+ int i;
+ for (i = 0; i < num; ++i)
+ p_cur[i].gateways = p_cur[i].addresses;
+}
+
static void onCompleteQueryAvailableNetworks(RIL_Token t, RIL_Errno e, void *response, size_t responselen) {
/* Response is a char **, pointing to an array of char *'s */
size_t numStrings = responselen / sizeof(char *);
@@ -126,6 +135,16 @@ static void onRequestCompleteShim(RIL_Token t, RIL_Errno e, void *response, size
return;
}
break;
+ case RIL_REQUEST_DATA_CALL_LIST:
+ case RIL_REQUEST_SETUP_DATA_CALL:
+ /* According to the Samsung RIL, the addresses are the gateways?
+ * This fixes mobile data. */
+ if (response != NULL && responselen != 0 && (responselen % sizeof(RIL_Data_Call_Response_v6) == 0)) {
+ fixupDataCallList(response, responselen);
+ rilEnv->OnRequestComplete(t, e, response, responselen);
+ return;
+ }
+ break;
case RIL_REQUEST_QUERY_AVAILABLE_NETWORKS:
/* Remove the extra (unused) element from the operator info, freaking out the framework.
* Formerly, this is know as the mQANElements override. */
@@ -152,6 +171,12 @@ null_token_exit:
static void onUnsolicitedResponseShim(int unsolResponse, const void *data, size_t datalen)
{
switch (unsolResponse) {
+ case RIL_UNSOL_DATA_CALL_LIST_CHANGED:
+ /* According to the Samsung RIL, the addresses are the gateways?
+ * This fixes mobile data. */
+ if (data != NULL && datalen != 0 && (datalen % sizeof(RIL_Data_Call_Response_v6) == 0))
+ fixupDataCallList((void*) data, datalen);
+ break;
case RIL_UNSOL_SIGNAL_STRENGTH:
/* The Samsung RIL reports the signal strength in a strange way... */
if (data != NULL && datalen >= sizeof(RIL_SignalStrength_v5))