return Void();
}
// safe to copy to geran_bands because it's a union member
- std::memcpy(&ras_to.bands.geran_bands, bands, ras_to.bands_length * sizeof(uint32_t));
+ for (size_t idx = 0; idx < ras_to.bands_length; ++idx) {
+ ras_to.bands.geran_bands[idx] = (RIL_GeranBands) (*bands)[idx];
+ }
}
s_vendorFunctions->onRequest(
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 =
} 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();
case RIL_CELL_INFO_TYPE_CDMA:{
rilCellIdentity.cellIdentityCdma.basestationId =
convertResponseStringEntryToInt(response, 4, numStrings);
- rilCellIdentity.cellIdentityCdma.longitude =
- convertResponseStringEntryToInt(response, 5, numStrings);
+ /* Order of Lat. and Long. swapped between RIL and HIDL interface versions. */
rilCellIdentity.cellIdentityCdma.latitude =
+ convertResponseStringEntryToInt(response, 5, numStrings);
+ rilCellIdentity.cellIdentityCdma.longitude =
convertResponseStringEntryToInt(response, 6, numStrings);
rilCellIdentity.cellIdentityCdma.systemId =
convertResponseStringEntryToInt(response, 8, numStrings);