libril: Add support custom numStrings

* need for getDataRegistrationStateResponse
 setprop ro.ril.telephony.nstrings=N
Change-Id: Ie191063895cba348d949e20d8108c5ace5543df1
This commit is contained in:
danile71 2017-11-08 13:28:10 +03:00 committed by Dominggoes Isakh
parent 08c95948f7
commit c2b270520b

View file

@ -3710,6 +3710,10 @@ int radio::getDataRegistrationStateResponse(int slotId,
#if VDBG
RLOGD("getDataRegistrationStateResponse: serial %d", serial);
#endif
char value[PROPERTY_VALUE_MAX];
int nstrings;
property_get("ro.ril.telephony.nstrings", value, "6");
nstrings = atoi(value);
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
@ -3720,7 +3724,7 @@ int radio::getDataRegistrationStateResponse(int slotId,
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else if (s_vendorFunctions->version <= 14) {
int numStrings = responseLen / sizeof(char *);
if (numStrings < 6) {
if ((numStrings != 6) && (numStrings != 11) && (numStrings != nstrings)) {
RLOGE("getDataRegistrationStateResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {