From d26f4c920fbfffe4df90a1c82a6f46ad006e653b Mon Sep 17 00:00:00 2001 From: "Christopher N. Hesse" Date: Fri, 23 Feb 2018 19:07:27 +0100 Subject: [PATCH] ril: service: Fix breakage introduced by f7c75aa4e0 Before: if (response == NULL || numStrings != 3) { After: if (response == NULL || numStrings != mqanelements - 2) { This patch fixes the logic so we don't change the value check. "mqanelements" is not related to getOperatorResponse, so get get rid of the affected code. Change-Id: I86c6ae7b7492a5d04fbc8dc415c4f615e7d05bab --- ril/libril/ril_service.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ril/libril/ril_service.cpp b/ril/libril/ril_service.cpp index f4f06d5..87b1a4a 100644 --- a/ril/libril/ril_service.cpp +++ b/ril/libril/ril_service.cpp @@ -3712,10 +3712,6 @@ int radio::getOperatorResponse(int slotId, #if VDBG RLOGD("getOperatorResponse: serial %d", serial); #endif - int mqanelements; - char value[PROPERTY_VALUE_MAX]; - property_get("ro.ril.telephony.mqanelements", value, "4"); - mqanelements = atoi(value); if (radioService[slotId]->mRadioResponse != NULL) { RadioResponseInfo responseInfo = {}; @@ -3724,14 +3720,14 @@ int radio::getOperatorResponse(int slotId, hidl_string shortName; hidl_string numeric; int numStrings = responseLen / sizeof(char *); - if (response == NULL || numStrings != mqanelements - 2) { + if (response == NULL || numStrings != 3) { RLOGE("getOperatorResponse Invalid response: NULL"); if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE; } else { char **resp = (char **) response; longName = convertCharPtrToHidlString(resp[0]); - shortName = convertCharPtrToHidlString(resp[0]); + shortName = convertCharPtrToHidlString(resp[1]); numeric = convertCharPtrToHidlString(resp[2]); } Return retStatus = radioService[slotId]->mRadioResponse->getOperatorResponse( -- 2.20.1