libril: Fix network operator search

Change-Id: Ib904875c403942ec96dfa229080d9543d7c9b8fa
tirimbino
Utkarsh Gupta 10 years ago committed by Ethan Chen
parent 8ede9fa98b
commit f7a63e5be9
  1. 13
      ril/libril/ril.cpp
  2. 2
      ril/libril/ril_commands.h

@ -284,6 +284,7 @@ static void dispatchRadioCapability(Parcel &p, RequestInfo *pRI);
static int responseInts(Parcel &p, void *response, size_t responselen);
static int responseIntsGetPreferredNetworkType(Parcel &p, void *response, size_t responselen);
static int responseStrings(Parcel &p, void *response, size_t responselen);
static int responseStringsNetworks(Parcel &p, void *response, size_t responselen);
static int responseStrings(Parcel &p, void *response, size_t responselen, bool network_search);
static int responseString(Parcel &p, void *response, size_t responselen);
static int responseVoid(Parcel &p, void *response, size_t responselen);
@ -2271,6 +2272,10 @@ static int responseStrings(Parcel &p, void *response, size_t responselen) {
return responseStrings(p, response, responselen, false);
}
static int responseStringsNetworks(Parcel &p, void *response, size_t responselen) {
return responseStrings(p, response, responselen, true);
}
/** response is a char **, pointing to an array of char *'s */
static int responseStrings(Parcel &p, void *response, size_t responselen, bool network_search) {
int numStrings;
@ -2291,11 +2296,17 @@ static int responseStrings(Parcel &p, void *response, size_t responselen, bool n
char **p_cur = (char **) response;
numStrings = responselen / sizeof(char *);
p.writeInt32 (numStrings);
if (network_search) {
p.writeInt32 ((numStrings / 5) * 4);
} else {
p.writeInt32 (numStrings);
}
/* each string*/
startResponse;
for (int i = 0 ; i < numStrings ; i++) {
if (network_search && (i % 5 == 0))
continue;
appendPrintBuf("%s%s,", printBuf, (char*)p_cur[i]);
writeStringToParcel (p, p_cur[i]);
}

@ -62,7 +62,7 @@
{RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE, dispatchVoid, responseInts},
{RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC, dispatchVoid, responseVoid},
{RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL, dispatchString, responseVoid},
{RIL_REQUEST_QUERY_AVAILABLE_NETWORKS , dispatchVoid, responseStrings},
{RIL_REQUEST_QUERY_AVAILABLE_NETWORKS , dispatchVoid, responseStringsNetworks},
{RIL_REQUEST_DTMF_START, dispatchString, responseVoid},
{RIL_REQUEST_DTMF_STOP, dispatchVoid, responseVoid},
{RIL_REQUEST_BASEBAND_VERSION, dispatchVoid, responseString},

Loading…
Cancel
Save