using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_array;
using ::android::hardware::radio::V1_1::NetworkScanRequest;
+using ::android::hardware::radio::V1_1::KeepaliveRequest;
using ::android::hardware::Void;
using android::CommandInfo;
using android::RequestInfo;
#define ATOI_NULL_HANDLED(x) (x ? atoi(x) : -1)
#define ATOI_NULL_HANDLED_DEF(x, defaultVal) (x ? atoi(x) : defaultVal)
+#if defined(ANDROID_MULTI_SIM)
+#define CALL_ONREQUEST(a, b, c, d, e) \
+ s_vendorFunctions->onRequest((a), (b), (c), (d), ((RIL_SOCKET_ID)(e)))
+#define CALL_ONSTATEREQUEST(a) s_vendorFunctions->onStateRequest((RIL_SOCKET_ID)(a))
+#else
+#define CALL_ONREQUEST(a, b, c, d, e) s_vendorFunctions->onRequest((a), (b), (c), (d))
+#define CALL_ONSTATEREQUEST(a) s_vendorFunctions->onStateRequest()
+#endif
+
RIL_RadioFunctions *s_vendorFunctions = NULL;
static CommandInfo *s_commands;
Return<void> setIndicationFilter(int32_t serial, int32_t indicationFilter);
+ Return<void> startKeepalive(int32_t serial, const KeepaliveRequest& keepalive);
+
+ Return<void> stopKeepalive(int32_t serial, int32_t sessionHandle);
+
Return<void> setSimCardPower(int32_t serial, bool powerUp);
Return<void> setSimCardPower_1_1(int32_t serial,
const ::android::hardware::radio::V1_1::CardPowerState state);
if (pRI == NULL) {
return false;
}
- s_vendorFunctions->onRequest(request, NULL, 0, pRI);
+ CALL_ONREQUEST(request, NULL, 0, pRI, slotId);
return true;
}
return false;
}
- s_vendorFunctions->onRequest(request, pString, sizeof(char *), pRI);
+ CALL_ONREQUEST(request, pString, sizeof(char *), pRI, slotId);
memsetAndFreeStrings(1, pString);
return true;
}
va_end(ap);
- s_vendorFunctions->onRequest(request, pStrings, countStrings * sizeof(char *), pRI);
+ CALL_ONREQUEST(request, pStrings, countStrings * sizeof(char *), pRI, slotId);
if (pStrings != NULL) {
for (int i = 0 ; i < countStrings ; i++) {
}
}
- s_vendorFunctions->onRequest(request, pStrings, countStrings * sizeof(char *), pRI);
+ CALL_ONREQUEST(request, pStrings, countStrings * sizeof(char *), pRI, slotId);
if (pStrings != NULL) {
for (int i = 0 ; i < countStrings ; i++) {
}
va_end(ap);
- s_vendorFunctions->onRequest(request, pInts, countInts * sizeof(int), pRI);
+ CALL_ONREQUEST(request, pInts, countInts * sizeof(int), pRI, slotId);
if (pInts != NULL) {
#ifdef MEMSET_FREED
return false;
}
- s_vendorFunctions->onRequest(request, &cf, sizeof(cf), pRI);
+ CALL_ONREQUEST(request, &cf, sizeof(cf), pRI, slotId);
memsetAndFreeStrings(1, cf.number);
const uint8_t *uData = rawBytes.data();
- s_vendorFunctions->onRequest(request, (void *) uData, rawBytes.size(), pRI);
+ CALL_ONREQUEST(request, (void *) uData, rawBytes.size(), pRI, slotId);
return true;
}
return false;
}
- s_vendorFunctions->onRequest(request, &apdu, sizeof(apdu), pRI);
+ CALL_ONREQUEST(request, &apdu, sizeof(apdu), pRI, slotId);
memsetAndFreeStrings(1, apdu.data);
dial.uusInfo = &uusInfo;
}
- s_vendorFunctions->onRequest(RIL_REQUEST_DIAL, &dial, sizeOfDial, pRI);
+ CALL_ONREQUEST(RIL_REQUEST_DIAL, &dial, sizeOfDial, pRI, mSlotId);
memsetAndFreeStrings(2, dial.address, uusInfo.uusData);
return Void();
}
- s_vendorFunctions->onRequest(RIL_REQUEST_SIM_IO, &rilIccIo, sizeof(rilIccIo), pRI);
+ CALL_ONREQUEST(RIL_REQUEST_SIM_IO, &rilIccIo, sizeof(rilIccIo), pRI, mSlotId);
memsetAndFreeStrings(4, rilIccIo.path, rilIccIo.data, rilIccIo.pin2, rilIccIo.aidPtr);
RLOGD("setBarringPassword: serial %d", serial);
#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_CHANGE_BARRING_PASSWORD,
- 2, oldPassword.c_str(), newPassword.c_str());
+ 3, facility.c_str(), oldPassword.c_str(), newPassword.c_str());
return Void();
}
return Void();
}
- s_vendorFunctions->onRequest(RIL_REQUEST_WRITE_SMS_TO_SIM, &args, sizeof(args), pRI);
+ CALL_ONREQUEST(RIL_REQUEST_WRITE_SMS_TO_SIM, &args, sizeof(args), pRI, mSlotId);
memsetAndFreeStrings(2, args.smsc, args.pdu);
RIL_CDMA_SMS_Message rcsm = {};
constructCdmaSms(rcsm, sms);
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rcsm, sizeof(rcsm), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rcsm, sizeof(rcsm), pRI, mSlotId);
return Void();
}
rcsa.uErrorClass = (RIL_CDMA_SMS_ErrorClass) smsAck.errorClass;
rcsa.uSMSCauseCode = smsAck.smsCauseCode;
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rcsa, sizeof(rcsa), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rcsa, sizeof(rcsa), pRI, mSlotId);
return Void();
}
gsmBci[i].selected = BOOL_TO_INT(configInfo[i].selected);
}
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, gsmBciPtrs,
- num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, gsmBciPtrs,
+ num * sizeof(RIL_GSM_BroadcastSmsConfigInfo *), pRI, mSlotId);
return Void();
}
cdmaBci[i].selected = BOOL_TO_INT(configInfo[i].selected);
}
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, cdmaBciPtrs,
- num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, cdmaBciPtrs,
+ num * sizeof(RIL_CDMA_BroadcastSmsConfigInfo *), pRI, mSlotId);
return Void();
}
rcsw.status = (int) cdmaSms.status;
constructCdmaSms(rcsw.message, cdmaSms.message);
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rcsw, sizeof(rcsw), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rcsw, sizeof(rcsw), pRI, mSlotId);
return Void();
}
if (s_vendorFunctions->version <= 14) {
RIL_InitialAttachApn iaa = {};
- if (!copyHidlStringToRil(&iaa.apn, dataProfileInfo.apn, pRI)) {
- return Void();
+ if (dataProfileInfo.apn.size() == 0) {
+ iaa.apn = (char *) calloc(1, sizeof(char));
+ if (iaa.apn == NULL) {
+ RLOGE("Memory allocation failed for request %s",
+ requestToString(pRI->pCI->requestNumber));
+ sendErrorResponse(pRI, RIL_E_NO_MEMORY);
+ return Void();
+ }
+ iaa.apn[0] = '\0';
+ } else {
+ if (!copyHidlStringToRil(&iaa.apn, dataProfileInfo.apn, pRI)) {
+ return Void();
+ }
}
const hidl_string &protocol =
return Void();
}
- s_vendorFunctions->onRequest(RIL_REQUEST_SET_INITIAL_ATTACH_APN, &iaa, sizeof(iaa), pRI);
+ CALL_ONREQUEST(RIL_REQUEST_SET_INITIAL_ATTACH_APN, &iaa, sizeof(iaa), pRI, mSlotId);
memsetAndFreeStrings(4, iaa.apn, iaa.protocol, iaa.username, iaa.password);
} else {
RIL_InitialAttachApn_v15 iaa = {};
- if (!copyHidlStringToRil(&iaa.apn, dataProfileInfo.apn, pRI)) {
- return Void();
+ if (dataProfileInfo.apn.size() == 0) {
+ iaa.apn = (char *) calloc(1, sizeof(char));
+ if (iaa.apn == NULL) {
+ RLOGE("Memory allocation failed for request %s",
+ requestToString(pRI->pCI->requestNumber));
+ sendErrorResponse(pRI, RIL_E_NO_MEMORY);
+ return Void();
+ }
+ iaa.apn[0] = '\0';
+ } else {
+ if (!copyHidlStringToRil(&iaa.apn, dataProfileInfo.apn, pRI)) {
+ return Void();
+ }
}
+
if (!copyHidlStringToRil(&iaa.protocol, dataProfileInfo.protocol, pRI)) {
memsetAndFreeStrings(1, iaa.apn);
return Void();
return Void();
}
- s_vendorFunctions->onRequest(RIL_REQUEST_SET_INITIAL_ATTACH_APN, &iaa, sizeof(iaa), pRI);
+ CALL_ONREQUEST(RIL_REQUEST_SET_INITIAL_ATTACH_APN, &iaa, sizeof(iaa), pRI, mSlotId);
memsetAndFreeStrings(6, iaa.apn, iaa.protocol, iaa.roamingProtocol, iaa.username,
iaa.password, iaa.mvnoMatchData);
}
rism.message.gsmMessage = pStrings;
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rism, sizeof(RIL_RadioTechnologyFamily) +
- sizeof(uint8_t) + sizeof(int32_t) + dataLen, pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rism, sizeof(RIL_RadioTechnologyFamily) +
+ sizeof(uint8_t) + sizeof(int32_t) + dataLen, pRI, pRI->socket_id);
for (int i = 0 ; i < countStrings ; i++) {
memsetAndFreeStrings(1, pStrings[i]);
constructCdmaSms(rcsm, message.cdmaMessage[0]);
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rism, sizeof(RIL_RadioTechnologyFamily) +
- sizeof(uint8_t) + sizeof(int32_t) + sizeof(rcsm), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rism, sizeof(RIL_RadioTechnologyFamily) +
+ sizeof(uint8_t) + sizeof(int32_t) + sizeof(rcsm), pRI, pRI->socket_id);
return true;
}
return Void();
}
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, ¶ms, sizeof(params), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, ¶ms, sizeof(params), pRI, mSlotId);
memsetAndFreeStrings(1, params.aidPtr);
}
RIL_NV_ReadItem nvri = {};
nvri.itemID = (RIL_NV_Item) itemId;
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &nvri, sizeof(nvri), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &nvri, sizeof(nvri), pRI, mSlotId);
return Void();
}
return Void();
}
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &nvwi, sizeof(nvwi), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &nvwi, sizeof(nvwi), pRI, mSlotId);
memsetAndFreeStrings(1, nvwi.value);
return Void();
rilUiccSub.sub_type = (RIL_SubscriptionType) uiccSub.subType;
rilUiccSub.act_status = (RIL_UiccSubActStatus) uiccSub.actStatus;
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rilUiccSub, sizeof(rilUiccSub), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rilUiccSub, sizeof(rilUiccSub), pRI, mSlotId);
return Void();
}
return Void();
}
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &pf, sizeof(pf), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &pf, sizeof(pf), pRI, mSlotId);
memsetAndFreeStrings(2, pf.authData, pf.aid);
return Void();
dataProfiles[i].enabled = BOOL_TO_INT(profiles[i].enabled);
}
- s_vendorFunctions->onRequest(RIL_REQUEST_SET_DATA_PROFILE, dataProfilePtrs,
- num * sizeof(RIL_DataProfileInfo *), pRI);
+ CALL_ONREQUEST(RIL_REQUEST_SET_DATA_PROFILE, dataProfilePtrs,
+ num * sizeof(RIL_DataProfileInfo *), pRI, mSlotId);
freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 4,
&RIL_DataProfileInfo::apn, &RIL_DataProfileInfo::protocol,
dataProfiles[i].mtu = profiles[i].mtu;
}
- s_vendorFunctions->onRequest(RIL_REQUEST_SET_DATA_PROFILE, dataProfilePtrs,
- num * sizeof(RIL_DataProfileInfo_v15 *), pRI);
+ CALL_ONREQUEST(RIL_REQUEST_SET_DATA_PROFILE, dataProfilePtrs,
+ num * sizeof(RIL_DataProfileInfo_v15 *), pRI, mSlotId);
freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 6,
&RIL_DataProfileInfo_v15::apn, &RIL_DataProfileInfo_v15::protocol,
rilRc.status = (int) rc.status;
strncpy(rilRc.logicalModemUuid, rc.logicalModemUuid.c_str(), MAX_UUID_LENGTH);
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rilRc, sizeof(rilRc), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &rilRc, sizeof(rilRc), pRI, mSlotId);
return Void();
}
excludedCarriers[i].match_data = carriers.excludedCarriers[i].matchData.c_str();
}
- s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &cr, sizeof(RIL_CarrierRestrictions), pRI);
+ CALL_ONREQUEST(pRI->pCI->requestNumber, &cr, sizeof(RIL_CarrierRestrictions), pRI, mSlotId);
#ifdef MEMSET_FREED
memset(allowedCarriers, 0, cr.len_allowed_carriers * sizeof(RIL_Carrier));
return Void();
}
+Return<void> RadioImpl::startKeepalive(int32_t serial, const KeepaliveRequest& keepalive) {
+ RLOGD("startKeepalive: serial %d", serial);
+ return Void();
+}
+
+Return<void> RadioImpl::stopKeepalive(int32_t serial, int32_t sessionHandle) {
+ RLOGD("stopKeepalive: serial %d", serial);
+ return Void();
+}
+
+
/***************************************************************************************************
* RESPONSE FUNCTIONS
* Functions above are used for requests going from framework to vendor code. The ones below are
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
CardStatus cardStatus = {};
- if (response == NULL || responseLen != sizeof(RIL_CardStatus_v6)) {
+ RIL_CardStatus_v6 *p_cur = ((RIL_CardStatus_v6 *) response);
+ if (response == NULL || responseLen != sizeof(RIL_CardStatus_v6)
+ || p_cur->gsm_umts_subscription_app_index >= p_cur->num_applications
+ || p_cur->cdma_subscription_app_index >= p_cur->num_applications
+ || p_cur->ims_subscription_app_index >= p_cur->num_applications) {
RLOGE("getIccCardStatusResponse: Invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
- RIL_CardStatus_v6 *p_cur = ((RIL_CardStatus_v6 *) response);
cardStatus.cardState = (CardState) p_cur->card_state;
cardStatus.universalPinState = (PinState) p_cur->universal_pin_state;
cardStatus.gsmUmtsSubscriptionAppIndex = p_cur->gsm_umts_subscription_app_index;
int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
supplyIccPinForAppResponse(responseInfo, ret);
+ RLOGE("supplyIccPinForAppResponse: amit ret %d", ret);
radioService[slotId]->checkReturnStatus(retStatus);
} else {
RLOGE("supplyIccPinForAppResponse: radioService[%d]->mRadioResponse == NULL",
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<Call> calls;
- if (response == NULL || (responseLen % sizeof(RIL_Call *)) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || (responseLen % sizeof(RIL_Call *)) != 0) {
RLOGE("getCurrentCallsResponse: Invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
return -1;
}
+int convertResponseHexStringEntryToInt(char **response, int index, int numStrings) {
+ const int hexBase = 16;
+ if ((response != NULL) && (numStrings > index) && (response[index] != NULL)) {
+ return strtol(response[index], NULL, hexBase);
+ }
+
+ return -1;
+}
+
+/* Fill Cell Identity info from Voice Registration State Response.
+ * This fucntion is applicable only for RIL Version < 15.
+ * Response is a "char **".
+ * First and Second entries are in hex string format
+ * and rest are integers represented in ascii format. */
void fillCellIdentityFromVoiceRegStateResponseString(CellIdentity &cellIdentity,
int numStrings, char** response) {
switch(rilCellIdentity.cellInfoType) {
case RIL_CELL_INFO_TYPE_GSM: {
+ /* valid LAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityGsm.lac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityGsm.cid =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
break;
}
case RIL_CELL_INFO_TYPE_WCDMA: {
+ /* valid LAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityWcdma.lac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityWcdma.cid =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
rilCellIdentity.cellIdentityWcdma.psc =
convertResponseStringEntryToInt(response, 14, numStrings);
break;
}
case RIL_CELL_INFO_TYPE_TD_SCDMA:{
+ /* valid LAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityTdscdma.lac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityTdscdma.cid =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
break;
}
}
case RIL_CELL_INFO_TYPE_LTE:{
+ /* valid TAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityLte.tac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityLte.ci =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
break;
}
fillCellIdentityResponse(cellIdentity, rilCellIdentity);
}
+/* Fill Cell Identity info from Data Registration State Response.
+ * This fucntion is applicable only for RIL Version < 15.
+ * Response is a "char **".
+ * First and Second entries are in hex string format
+ * and rest are integers represented in ascii format. */
void fillCellIdentityFromDataRegStateResponseString(CellIdentity &cellIdentity,
int numStrings, char** response) {
rilCellIdentity.cellInfoType = getCellInfoTypeRadioTechnology(response[3]);
switch(rilCellIdentity.cellInfoType) {
case RIL_CELL_INFO_TYPE_GSM: {
+ /* valid LAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityGsm.lac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityGsm.cid =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
break;
}
case RIL_CELL_INFO_TYPE_WCDMA: {
+ /* valid LAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityWcdma.lac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityWcdma.cid =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
break;
}
case RIL_CELL_INFO_TYPE_TD_SCDMA:{
+ /* valid LAC are hexstrings in the range 0x0000 - 0xffff */
rilCellIdentity.cellIdentityTdscdma.lac =
- convertResponseStringEntryToInt(response, 1, numStrings);
+ convertResponseHexStringEntryToInt(response, 1, numStrings);
+
+ /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */
rilCellIdentity.cellIdentityTdscdma.cid =
- convertResponseStringEntryToInt(response, 2, numStrings);
+ convertResponseHexStringEntryToInt(response, 2, numStrings);
break;
}
case RIL_CELL_INFO_TYPE_LTE: {
populateResponseInfo(responseInfo, serial, responseType, e);
SetupDataCallResult result = {};
- if (response == NULL || responseLen != sizeof(RIL_Data_Call_Response_v11)) {
- RLOGE("setupDataCallResponse: Invalid response");
- if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+ if (response == NULL || (responseLen % sizeof(RIL_Data_Call_Response_v11)) != 0) {
+ if (response != NULL) {
+ RLOGE("setupDataCallResponse: Invalid response");
+ if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+ }
result.status = DataCallFailCause::ERROR_UNSPECIFIED;
result.type = hidl_string();
result.ifname = hidl_string();
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<CallForwardInfo> callForwardInfos;
- if (response == NULL || responseLen % sizeof(RIL_CallForwardInfo *) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_CallForwardInfo *) != 0) {
RLOGE("getCallForwardStatusResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<OperatorInfo> networks;
- if (response == NULL || responseLen % (4 * sizeof(char *))!= 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % (4 * sizeof(char *))!= 0) {
RLOGE("getAvailableNetworksResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<SetupDataCallResult> ret;
- if (response == NULL || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
RLOGE("getDataCallListResponse: invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<RadioBandMode> modes;
- if (response == NULL || responseLen % sizeof(int) != 0) {
+ if ((response == NULL && responseLen != 0)|| responseLen % sizeof(int) != 0) {
RLOGE("getAvailableBandModesResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<NeighboringCell> cells;
- if (response == NULL || responseLen % sizeof(RIL_NeighboringCell *) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_NeighboringCell *) != 0) {
RLOGE("getNeighboringCidsResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<GsmBroadcastSmsConfigInfo> configs;
- if (response == NULL || responseLen % sizeof(RIL_GSM_BroadcastSmsConfigInfo *) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_GSM_BroadcastSmsConfigInfo *) != 0) {
RLOGE("getGsmBroadcastConfigResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<CdmaBroadcastSmsConfigInfo> configs;
- if (response == NULL || responseLen % sizeof(RIL_CDMA_BroadcastSmsConfigInfo *) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_CDMA_BroadcastSmsConfigInfo *) != 0) {
RLOGE("getCdmaBroadcastConfigResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<CellInfo> ret;
- if (response == NULL || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
RLOGE("getCellInfoListResponse: Invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
int numInts = responseLen / sizeof(int);
if (response == NULL || responseLen % sizeof(int) != 0) {
RLOGE("iccOpenLogicalChannelResponse Invalid response: NULL");
- if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+ if (response != NULL) {
+ if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+ }
} else {
int *pInt = (int *) response;
channelId = pInt[0];
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<HardwareConfig> result;
- if (response == NULL || responseLen % sizeof(RIL_HardwareConfig) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_HardwareConfig) != 0) {
RLOGE("hardwareConfigChangedInd: invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
populateResponseInfo(responseInfo, serial, responseType, e);
hidl_vec<hidl_string> data;
- if (response == NULL || responseLen % sizeof(char *) != 0) {
+ if ((response == NULL && responseLen != 0) || responseLen % sizeof(char *) != 0) {
RLOGE("sendRequestStringsResponse Invalid response: NULL");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
- RadioState radioState = (RadioState) s_vendorFunctions->onStateRequest();
+ RadioState radioState =
+ (RadioState) CALL_ONSTATEREQUEST(slotId);
RLOGD("radioStateChangedInd: radioState %d", radioState);
Return<void> retStatus = radioService[slotId]->mRadioIndication->radioStateChanged(
convertIntToRadioIndicationType(indicationType), radioState);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
- if (response == NULL || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
RLOGE("dataCallListChangedInd: invalid response");
return 0;
}
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
- if (response == NULL || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
+ if ((response == NULL && responseLen != 0) || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
RLOGE("cellInfoListInd: invalid response");
return 0;
}
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
- if (response == NULL || responseLen % sizeof(RIL_HardwareConfig) != 0) {
+ if ((response == NULL && responseLen != 0)
+ || responseLen % sizeof(RIL_HardwareConfig) != 0) {
RLOGE("hardwareConfigChangedInd: invalid response");
return 0;
}