From e32a755ed28617b89950e660025efec74ddbb456 Mon Sep 17 00:00:00 2001 From: Pengquan Meng Date: Mon, 28 Jan 2019 16:38:10 -0800 Subject: [PATCH] Add 5G cellInfo & signal strength Bug: 123532650 Test: build Change-Id: I76bff3f6ff56ef76cb357c327b44d54757952e32 --- radio/1.4/Android.bp | 4 + radio/1.4/IRadio.hal | 9 ++ radio/1.4/IRadioIndication.hal | 8 + radio/1.4/IRadioResponse.hal | 11 ++ radio/1.4/types.hal | 153 +++++++++++++++++- .../functional/radio_hidl_hal_utils_v1_4.h | 8 +- radio/1.4/vts/functional/radio_indication.cpp | 7 +- radio/1.4/vts/functional/radio_response.cpp | 9 +- 8 files changed, 202 insertions(+), 7 deletions(-) diff --git a/radio/1.4/Android.bp b/radio/1.4/Android.bp index 9fd037434d..e8b87778d5 100644 --- a/radio/1.4/Android.bp +++ b/radio/1.4/Android.bp @@ -25,8 +25,10 @@ hidl_interface { "CardStatus", "CarrierRestrictionsWithPriority", "CellConfigLte", + "CellIdentityNr", "CellInfo", "CellInfoLte", + "CellInfoNr", "DataCallFailCause", "DataConnActiveStatus", "DataProfileInfo", @@ -39,6 +41,7 @@ hidl_interface { "LteVopsInfo", "NetworkScanResult", "NrIndicators", + "NrSignalStrength", "PdpProtocolType", "PhysicalChannelConfig", "RadioAccessFamily", @@ -46,6 +49,7 @@ hidl_interface { "RadioFrequencyInfo", "RadioTechnology", "SetupDataCallResult", + "SignalStrength", "SimLockMultiSimPolicy", ], gen_java: true, diff --git a/radio/1.4/IRadio.hal b/radio/1.4/IRadio.hal index 21c509766a..8ef1f962e3 100644 --- a/radio/1.4/IRadio.hal +++ b/radio/1.4/IRadio.hal @@ -215,4 +215,13 @@ interface IRadio extends @1.3::IRadio { * Response callback is IRadioResponse.getAllowedCarriersResponse_1_3() */ oneway getAllowedCarriers_1_4(int32_t serial); + + /** + * Requests current signal strength and associated information. Must succeed if radio is on. + * + * @param serial Serial number of request. + * + * Response function is IRadioResponse.getSignalStrengthResponse_1_4() + */ + oneway getSignalStrength_1_4(int32_t serial); }; diff --git a/radio/1.4/IRadioIndication.hal b/radio/1.4/IRadioIndication.hal index 58b7b70d34..3c61f962d5 100644 --- a/radio/1.4/IRadioIndication.hal +++ b/radio/1.4/IRadioIndication.hal @@ -89,4 +89,12 @@ interface IRadioIndication extends @1.3::IRadioIndication { * 3. Unsolicited disconnect from either modem or network side. */ oneway dataCallListChanged_1_4(RadioIndicationType type, vec dcList); + + /** + * Indicates current signal strength of the radio. + * + * @param type Type of radio indication + * @param signalStrength SignalStrength information + */ + oneway currentSignalStrength_1_4(RadioIndicationType type, SignalStrength signalStrength); }; diff --git a/radio/1.4/IRadioResponse.hal b/radio/1.4/IRadioResponse.hal index 6b8977d09c..f43295ae71 100644 --- a/radio/1.4/IRadioResponse.hal +++ b/radio/1.4/IRadioResponse.hal @@ -24,6 +24,7 @@ import @1.4::CellInfo; import @1.4::DataRegStateResult; import @1.4::RadioAccessFamily; import @1.4::SetupDataCallResult; +import @1.4::SignalStrength; import @1.4::SimLockMultiSimPolicy; /** @@ -200,4 +201,14 @@ interface IRadioResponse extends @1.3::IRadioResponse { */ oneway getAllowedCarriersResponse_1_4(RadioResponseInfo info, CarrierRestrictionsWithPriority carriers, SimLockMultiSimPolicy multiSimPolicy); + + /** + * @param signalStrength Current signal strength + * + * Valid errors returned: + * RadioError:NONE + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway getSignalStrengthResponse_1_4(RadioResponseInfo info, SignalStrength signalStrength); }; diff --git a/radio/1.4/types.hal b/radio/1.4/types.hal index 6fa7ebd339..2747732730 100644 --- a/radio/1.4/types.hal +++ b/radio/1.4/types.hal @@ -20,12 +20,16 @@ import @1.0::ApnAuthType; import @1.0::ApnTypes; import @1.0::Carrier; import @1.0::CellInfoType; +import @1.0::CdmaSignalStrength; import @1.0::DataCallFailCause; import @1.0::DataProfileId; import @1.0::DataProfileInfoType; +import @1.0::EvdoSignalStrength; +import @1.0::GsmSignalStrength; +import @1.0::LteSignalStrength; import @1.0::RadioAccessFamily; import @1.0::RadioCapabilityPhase; -import @1.0::RadioCapabilityStatus ; +import @1.0::RadioCapabilityStatus; import @1.0::RadioError; import @1.0::RadioTechnology; import @1.0::RegState; @@ -39,10 +43,17 @@ import @1.2::CellInfoLte; import @1.2::CellInfoTdscdma; import @1.2::CellInfoWcdma; import @1.2::CardStatus; -import @1.2::CellIdentity; import @1.2::CellConnectionStatus; +import @1.2::CellIdentityCdma; +import @1.2::CellIdentityGsm; +import @1.2::CellIdentityLte; +import @1.2::CellIdentityTdscdma; +import @1.2::CellIdentityWcdma; +import @1.2::CellIdentityOperatorNames; import @1.2::DataRegStateResult; import @1.2::PhysicalChannelConfig; +import @1.2::TdscdmaSignalStrength; +import @1.2::WcdmaSignalStrength; import android.hidl.safe_union@1.0::Monostate; @@ -188,12 +199,12 @@ enum EmergencyCallRouting : int32_t { }; enum RadioTechnology : @1.0::RadioTechnology { - /** 5G NR. */ + /** 5G NR. This is only use in 5G Standalone mode. */ NR = 20, }; enum RadioAccessFamily : @1.0::RadioAccessFamily { - /** 5G NR. */ + /** 5G NR. This is only use in 5G Standalone mode. */ NR = 1 << RadioTechnology:NR, }; @@ -1551,9 +1562,15 @@ struct CellInfo { CellInfoWcdma wcdma; CellInfoTdscdma tdscdma; CellInfoLte lte; + CellInfoNr nr; } info; }; +struct CellInfoNr { + NrSignalStrength signalStrength; + CellIdentityNr cellidentity; +}; + /** Overwritten from @1.2::NetworkScanResult in order to update the CellInfo to 1.4 version. */ struct NetworkScanResult { /** @@ -1770,3 +1787,131 @@ struct CarrierRestrictionsWithPriority { */ bool allowedCarriersPrioritized; }; + +struct CellIdentityNr { + /** 3-digit Mobile Country Code, in range[0, 999], INT_MAX means invalid/unreported. */ + string mcc; + + /** + * 2 or 3-digit Mobile Network Code, in range [0, 999], INT_MAX means invalid/unreported. + */ + string mnc; + + /** + * Physical cell id in range [0, 1007] described in 3GPP TS 38.331. This value must be valid. + */ + uint32_t pci; + + /** 16-bit tracking area code, INT_MAX means invalid/unreported. */ + int32_t tac; + + /** + * NR Absolute Radio Frequency Channel Number, in range [0, 3279165]. + * Reference: 3GPP TS 38.101-1 and 3GPP TS 38.101-2 section 5.4.2.1. + * This value must be valid. + */ + int32_t nrarfcn; + + CellIdentityOperatorNames operatorNames; +}; + +struct NrSignalStrength { + /** + * SS reference signal received power, multipled by -1. + * + * Reference: 3GPP TS 38.215. + * + * Range [44, 140], INT_MAX means invalid/unreported. + */ + int32_t ssRsrp; + + /** + * SS reference signal received quality, multipled by -1. + * + * Reference: 3GPP TS 38.215. + * + * Range [3, 20], INT_MAX means invalid/unreported. + */ + int32_t ssRsrq; + + /** + * SS signal-to-noise and interference ratio. + * + * Reference: 3GPP TS 38.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. + * + * Range [-23, 40], INT_MAX means invalid/unreported. + */ + int32_t ssSinr; + + /** + * CSI reference signal received power, multipled by -1. + * + * Reference: 3GPP TS 38.215. + * + * Range [44, 140], INT_MAX means invalid/unreported. + */ + int32_t csiRsrp; + + /** + * CSI reference signal received quality, multipled by -1. + * + * Reference: 3GPP TS 38.215. + * + * Range [3, 20], INT_MAX means invalid/unreported. + */ + int32_t csiRsrq; + + /** + * CSI signal-to-noise and interference ratio. + * + * Reference: 3GPP TS 138.215 section 5.1.*, 3GPP TS 38.133 section 10.1.16.1. + * + * Range [-23, 40], INT_MAX means invalid/unreported. + */ + int32_t csiSinr; +}; + +/** Overwritten from @1.2::SignalStrength in order to add signal strength for NR. */ +struct SignalStrength { + /** + * If GSM measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + GsmSignalStrength gsm; + + /** + * If CDMA measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + CdmaSignalStrength cdma; + + /** + * If EvDO measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + EvdoSignalStrength evdo; + + /** + * If LTE measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + LteSignalStrength lte; + + /** + * If TD-SCDMA measurements are provided, this structure must contain valid measurements; + * otherwise all fields should be set to INT_MAX to mark them as invalid. + */ + TdscdmaSignalStrength tdscdma; + + /** + * If WCDMA measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + WcdmaSignalStrength wcdma; + + /** + * If NR 5G measurements are provided, this structure must contain valid measurements; otherwise + * all fields should be set to INT_MAX to mark them as invalid. + */ + NrSignalStrength nr; +}; diff --git a/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h b/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h index f290d5d58f..b77814f5a1 100644 --- a/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h +++ b/radio/1.4/vts/functional/radio_hidl_hal_utils_v1_4.h @@ -441,6 +441,9 @@ class RadioResponse_v1_4 : public ::android::hardware::radio::V1_4::IRadioRespon const RadioResponseInfo& info, const ::android::hardware::radio::V1_2::SignalStrength& sig_strength); + Return getSignalStrengthResponse_1_4(const RadioResponseInfo& info, + const ::android::hardware::radio::V1_4::SignalStrength& sig_strength); + Return getCellInfoListResponse_1_2( const RadioResponseInfo& info, const ::android::hardware::hidl_vec<::android::hardware::radio::V1_2::CellInfo>& @@ -559,6 +562,9 @@ class RadioIndication_v1_4 : public ::android::hardware::radio::V1_4::IRadioIndi RadioIndicationType type, const ::android::hardware::radio::V1_2::SignalStrength& signalStrength); + Return currentSignalStrength_1_4(RadioIndicationType type, + const ::android::hardware::radio::V1_4::SignalStrength& signalStrength); + /* 1.1 Api */ Return carrierInfoForImsiEncryption(RadioIndicationType info); @@ -730,4 +736,4 @@ class RadioHidlTest_v1_4 : public ::testing::VtsHalHidlTargetTestBase { /* radio indication handle */ sp radioInd_v1_4; -}; \ No newline at end of file +}; diff --git a/radio/1.4/vts/functional/radio_indication.cpp b/radio/1.4/vts/functional/radio_indication.cpp index f08b361637..c3722b0f7b 100644 --- a/radio/1.4/vts/functional/radio_indication.cpp +++ b/radio/1.4/vts/functional/radio_indication.cpp @@ -85,6 +85,11 @@ Return RadioIndication_v1_4::currentSignalStrength_1_2( return Void(); } +Return RadioIndication_v1_4::currentSignalStrength_1_4(RadioIndicationType /*type*/, + const ::android::hardware::radio::V1_4::SignalStrength& /*signalStrength*/) { + return Void(); +} + /* 1.1 Apis */ Return RadioIndication_v1_4::carrierInfoForImsiEncryption(RadioIndicationType /*info*/) { return Void(); @@ -321,4 +326,4 @@ Return RadioIndication_v1_4::pcoData(RadioIndicationType /*type*/, Return RadioIndication_v1_4::modemReset(RadioIndicationType /*type*/, const ::android::hardware::hidl_string& /*reason*/) { return Void(); -} \ No newline at end of file +} diff --git a/radio/1.4/vts/functional/radio_response.cpp b/radio/1.4/vts/functional/radio_response.cpp index 2ae5f7c17f..10ecead2a0 100644 --- a/radio/1.4/vts/functional/radio_response.cpp +++ b/radio/1.4/vts/functional/radio_response.cpp @@ -739,6 +739,13 @@ Return RadioResponse_v1_4::getSignalStrengthResponse_1_2( return Void(); } +Return RadioResponse_v1_4::getSignalStrengthResponse_1_4(const RadioResponseInfo& info, + const ::android::hardware::radio::V1_4::SignalStrength& /*sig_strength*/) { + rspInfo = info; + parent_v1_4.notify(info.serial); + return Void(); +} + Return RadioResponse_v1_4::getCellInfoListResponse_1_2( const RadioResponseInfo& /*info*/, const ::android::hardware::hidl_vec< @@ -864,4 +871,4 @@ Return RadioResponse_v1_4::getAllowedCarriersResponse_1_4( const RadioResponseInfo& /*info*/, const CarrierRestrictionsWithPriority& /*carriers*/, SimLockMultiSimPolicy /*multiSimPolicy*/) { return Void(); -} \ No newline at end of file +}