diff options
author | Gohulan Balachandran <gohulanb@quicinc.com> | 2019-02-05 11:20:46 -0800 |
---|---|---|
committer | Willy Hu <willycwhu@google.com> | 2019-02-14 20:17:21 +0800 |
commit | 453c835ecb2723ca4f336f15bc6ef2570eab38b1 (patch) | |
tree | cda0029356b19a30df6bf1f96652fb79dc09fc47 | |
parent | 840df81c0a5a1436ae440ab18a09380e059da1da (diff) | |
download | platform_hardware_ril-453c835ecb2723ca4f336f15bc6ef2570eab38b1.tar.gz platform_hardware_ril-453c835ecb2723ca4f336f15bc6ef2570eab38b1.tar.bz2 platform_hardware_ril-453c835ecb2723ca4f336f15bc6ef2570eab38b1.zip |
Handle MCC/MNC in data registration state provided by legacy vendor RILs
Include MCC/MNC provided by legacy (versions 14 and older) vendor RIL
implementations as part of data registration state, in data registration
state reported to clients of the radio HAL service.
Bug: 119904357
Test: local build and did the local test on Marlin device,
the mcc/mnc value are correct (not -1 and empty string value).
Change-Id: I5a26939402b86d889133e16f3508ab76b8bedddc
-rwxr-xr-x | libril/ril_service.cpp | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/libril/ril_service.cpp b/libril/ril_service.cpp index 0938ffc1..6220640d 100755 --- a/libril/ril_service.cpp +++ b/libril/ril_service.cpp @@ -3564,6 +3564,11 @@ void fillCellIdentityResponse(CellIdentity &cellIdentity, RIL_CellIdentity_v16 & std::to_string(rilCellIdentity.cellIdentityGsm.mcc); cellIdentity.cellIdentityGsm[0].mnc = ril::util::mnc::decode(rilCellIdentity.cellIdentityGsm.mnc); + + if (cellIdentity.cellIdentityGsm[0].mcc == "-1") { + cellIdentity.cellIdentityGsm[0].mcc = ""; + } + cellIdentity.cellIdentityGsm[0].lac = rilCellIdentity.cellIdentityGsm.lac; cellIdentity.cellIdentityGsm[0].cid = rilCellIdentity.cellIdentityGsm.cid; cellIdentity.cellIdentityGsm[0].arfcn = rilCellIdentity.cellIdentityGsm.arfcn; @@ -3577,6 +3582,11 @@ void fillCellIdentityResponse(CellIdentity &cellIdentity, RIL_CellIdentity_v16 & std::to_string(rilCellIdentity.cellIdentityWcdma.mcc); cellIdentity.cellIdentityWcdma[0].mnc = ril::util::mnc::decode(rilCellIdentity.cellIdentityWcdma.mnc); + + if (cellIdentity.cellIdentityWcdma[0].mcc == "-1") { + cellIdentity.cellIdentityWcdma[0].mcc = ""; + } + cellIdentity.cellIdentityWcdma[0].lac = rilCellIdentity.cellIdentityWcdma.lac; cellIdentity.cellIdentityWcdma[0].cid = rilCellIdentity.cellIdentityWcdma.cid; cellIdentity.cellIdentityWcdma[0].psc = rilCellIdentity.cellIdentityWcdma.psc; @@ -3601,6 +3611,11 @@ void fillCellIdentityResponse(CellIdentity &cellIdentity, RIL_CellIdentity_v16 & std::to_string(rilCellIdentity.cellIdentityLte.mcc); cellIdentity.cellIdentityLte[0].mnc = ril::util::mnc::decode(rilCellIdentity.cellIdentityLte.mnc); + + if (cellIdentity.cellIdentityLte[0].mcc == "-1") { + cellIdentity.cellIdentityLte[0].mcc = ""; + } + cellIdentity.cellIdentityLte[0].ci = rilCellIdentity.cellIdentityLte.ci; cellIdentity.cellIdentityLte[0].pci = rilCellIdentity.cellIdentityLte.pci; cellIdentity.cellIdentityLte[0].tac = rilCellIdentity.cellIdentityLte.tac; @@ -3614,6 +3629,11 @@ void fillCellIdentityResponse(CellIdentity &cellIdentity, RIL_CellIdentity_v16 & std::to_string(rilCellIdentity.cellIdentityTdscdma.mcc); cellIdentity.cellIdentityTdscdma[0].mnc = ril::util::mnc::decode(rilCellIdentity.cellIdentityTdscdma.mnc); + + if (cellIdentity.cellIdentityTdscdma[0].mcc == "-1") { + cellIdentity.cellIdentityTdscdma[0].mcc = ""; + } + cellIdentity.cellIdentityTdscdma[0].lac = rilCellIdentity.cellIdentityTdscdma.lac; cellIdentity.cellIdentityTdscdma[0].cid = rilCellIdentity.cellIdentityTdscdma.cid; cellIdentity.cellIdentityTdscdma[0].cpid = rilCellIdentity.cellIdentityTdscdma.cpid; @@ -3747,6 +3767,14 @@ void fillCellIdentityFromDataRegStateResponseString(CellIdentity &cellIdentity, /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */ rilCellIdentity.cellIdentityGsm.cid = convertResponseHexStringEntryToInt(response, 2, numStrings); + + if (numStrings >= 13) { + rilCellIdentity.cellIdentityGsm.mcc = + convertResponseStringEntryToInt(response, 11, numStrings); + + rilCellIdentity.cellIdentityGsm.mnc = + convertResponseStringEntryToInt(response, 12, numStrings); + } break; } case RIL_CELL_INFO_TYPE_WCDMA: { @@ -3757,6 +3785,14 @@ void fillCellIdentityFromDataRegStateResponseString(CellIdentity &cellIdentity, /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */ rilCellIdentity.cellIdentityWcdma.cid = convertResponseHexStringEntryToInt(response, 2, numStrings); + + if (numStrings >= 13) { + rilCellIdentity.cellIdentityWcdma.mcc = + convertResponseStringEntryToInt(response, 11, numStrings); + + rilCellIdentity.cellIdentityWcdma.mnc = + convertResponseStringEntryToInt(response, 12, numStrings); + } break; } case RIL_CELL_INFO_TYPE_TD_SCDMA:{ @@ -3767,6 +3803,14 @@ void fillCellIdentityFromDataRegStateResponseString(CellIdentity &cellIdentity, /* valid CID are hexstrings in the range 0x00000000 - 0xffffffff */ rilCellIdentity.cellIdentityTdscdma.cid = convertResponseHexStringEntryToInt(response, 2, numStrings); + + if (numStrings >= 13) { + rilCellIdentity.cellIdentityTdscdma.mcc = + convertResponseStringEntryToInt(response, 11, numStrings); + + rilCellIdentity.cellIdentityTdscdma.mnc = + convertResponseStringEntryToInt(response, 12, numStrings); + } break; } case RIL_CELL_INFO_TYPE_LTE: { @@ -3776,6 +3820,14 @@ void fillCellIdentityFromDataRegStateResponseString(CellIdentity &cellIdentity, convertResponseStringEntryToInt(response, 7, numStrings); rilCellIdentity.cellIdentityLte.ci = convertResponseStringEntryToInt(response, 8, numStrings); + + if (numStrings >= 13) { + rilCellIdentity.cellIdentityLte.mcc = + convertResponseStringEntryToInt(response, 11, numStrings); + + rilCellIdentity.cellIdentityLte.mnc = + convertResponseStringEntryToInt(response, 12, numStrings); + } break; } default: { @@ -3866,7 +3918,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) && (numStrings != 11)) { + if ((numStrings != 6) && (numStrings != 11) && (numStrings != 13)) { RLOGE("getDataRegistrationStateResponse Invalid response: NULL"); if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE; } else { |