From 21c6dc354866dab895536671039b50e6c22ab0cb Mon Sep 17 00:00:00 2001 From: Eric Schwarzenbach Date: Wed, 13 Dec 2017 15:52:15 -0800 Subject: [PATCH] Add reporting criteria to radio interface. Enables setting various reporting criteria for unsolicited signal strength and LCE reports. Creates a new LCE report including both up and down bandwidths. Updates documentation for various IndicationFilter bits to add clarity. Bug: 70638175 Test: n/a Change-Id: If8141fbd89baf85ed5ee65d589f111907a9bf8b4 --- radio/1.2/Android.bp | 2 + radio/1.2/IRadio.hal | 69 ++++++++++++++++++++++++++++++++++ radio/1.2/IRadioIndication.hal | 16 ++++++++ radio/1.2/IRadioResponse.hal | 22 +++++++++++ radio/1.2/types.hal | 51 +++++++++++++++++++++++++ 5 files changed, 160 insertions(+) diff --git a/radio/1.2/Android.bp b/radio/1.2/Android.bp index 56e4afd73c..3b2a01a632 100644 --- a/radio/1.2/Android.bp +++ b/radio/1.2/Android.bp @@ -31,6 +31,8 @@ hidl_interface { "CellInfoLte", "CellInfoWcdma", "IncrementalResultsPeriodicityRange", + "IndicationFilter", + "LinkCapacityEstimate", "MaxSearchTimeRange", "NetworkScanRequest", "NetworkScanResult", diff --git a/radio/1.2/IRadio.hal b/radio/1.2/IRadio.hal index 6ae78a0bfb..babe86f60e 100644 --- a/radio/1.2/IRadio.hal +++ b/radio/1.2/IRadio.hal @@ -17,6 +17,7 @@ package android.hardware.radio@1.2; import @1.1::IRadio; +import @1.1::RadioAccessNetworks; /** * This interface is used by telephony and telecom to talk to cellular radio. @@ -37,4 +38,72 @@ interface IRadio extends @1.1::IRadio { * Response function is IRadioResponse.startNetworkScanResponse() */ oneway startNetworkScan_1_2(int32_t serial, NetworkScanRequest request); + + /** + * Sets the indication filter. + * + * Prevents the reporting of specified unsolicited indications from the radio. This is used + * for power saving in instances when those indications are not needed. If unset, defaults to + * @1.2::IndicationFilter:ALL. + * + * @param serial Serial number of request. + * @param indicationFilter 32-bit bitmap of IndicationFilter. Bits set to 1 indicate the + * indications are enabled. See @1.2::IndicationFilter for the definition of each bit. + * + * Response callback is IRadioResponse.setIndicationFilterResponse() + */ + oneway setIndicationFilter_1_2(int32_t serial, bitfield indicationFilter); + + /** + * Sets the signal strength reporting criteria. + * + * The resulting reporting criteria are the AND of all the supplied criteria. + * + * Note: Reporting criteria must be individually set for each RAN. If unset, reporting criteria + * for that RAN are implementation-defined. + * + * Response callback is IRadioResponse.setSignalStrengthReportingCriteriaResponse(). + * + * @param serial Serial number of request. + * @param hysteresisMs A hysteresis time in milliseconds to prevent flapping. A value of 0 + * disables hysteresis. + * @param hysteresisDb An interval in dB defining the required magnitude change between reports. + * hysteresisDb must be smaller than the smallest threshold delta. An + * interval value of 0 disables hysteresis. + * @param thresholdsDbm A vector of trigger thresholds in dBm. A vector size of 0 disables the + * use of thresholds for reporting. + * @param ran The type of network for which to apply these thresholds. + */ + oneway setSignalStrengthReportingCriteria(int32_t serial, int32_t hysteresisMs, + int32_t hysteresisDb, vec thresholdsDbm, RadioAccessNetworks ran); + + /** + * Sets the link capacity reporting criteria. + * + * The resulting reporting criteria are the AND of all the supplied criteria. + * + * Note: Reporting criteria must be individually set for each RAN. If unset, reporting criteria + * for that RAN are implementation-defined. + * + * Response callback is IRadioResponse.setLinkCapacityReportingCriteriaResponse(). + * + * @param serial Serial number of request. + * @param hysteresisMs A hysteresis time in milliseconds to prevent flapping. A value of 0 + * disables hysteresis. + * @param hysteresisDlKbps An interval in kbps defining the required magnitude change between DL + * reports. hysteresisDlKbps must be smaller than the smallest threshold + * delta. A value of 0 disables hysteresis. + * @param hysteresisUlKbps An interval in kbps defining the required magnitude change between UL + * reports. hysteresisUlKbps must be smaller than the smallest threshold + * delta. A value of 0 disables hysteresis. + * @param thresholdsDownlinkKbps A vector of trigger thresholds in kbps for downlink reports. A + * vector size of 0 disables the use of DL thresholds for + * reporting. + * @param thresholdsUplinkKbps A vector of trigger thresholds in kbps for uplink reports. A + * vector size of 0 disables the use of UL thresholds for reporting. + * @param ran The type of network for which to apply these thresholds. + */ + oneway setLinkCapacityReportingCriteria(int32_t serial, int32_t hysteresisMs, + int32_t hysteresisDlKbps, int32_t hysteresisUlKbps, vec thresholdsDownlinkKbps, + vec thresholdsUplinkKbps, RadioAccessNetworks ran); }; diff --git a/radio/1.2/IRadioIndication.hal b/radio/1.2/IRadioIndication.hal index 22f655c625..2fb3038269 100644 --- a/radio/1.2/IRadioIndication.hal +++ b/radio/1.2/IRadioIndication.hal @@ -37,4 +37,20 @@ interface IRadioIndication extends @1.1::IRadioIndication { * @param records Current cell information known to radio */ oneway cellInfoList_1_2(RadioIndicationType type, vec records); + + /** + * Indicates current link capacity estimate. + * + * This replaces @1.0::IRadioIndication.lceData(). The framework must be able to handle + * either this function or @1.0::IRadioIndication.lceData(). Implementations supporting + * v1.2 must call this function instead of lceData(). + * + * This indication is sent whenever the reporting criteria, as set by + * @1.2::IRadio.setLinkCapacityReportingCriteria, are met and the indication is not + * suppressed by @1.2::IRadio.setIndicationFilter_1_2(). + * + * @param type Type of radio indication + * @param lce LinkCapacityEstimate information as defined in types.hal + */ + oneway currentLinkCapacityEstimate(RadioIndicationType type, LinkCapacityEstimate lce); }; diff --git a/radio/1.2/IRadioResponse.hal b/radio/1.2/IRadioResponse.hal index a7ad30c129..c356954cd7 100644 --- a/radio/1.2/IRadioResponse.hal +++ b/radio/1.2/IRadioResponse.hal @@ -50,4 +50,26 @@ interface IRadioResponse extends @1.1::IRadioResponse { * RadioError:NONE */ oneway getIccCardStatusResponse_1_2(RadioResponseInfo info, CardStatus cardStatus); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway setSignalStrengthReportingCriteriaResponse(RadioResponseInfo info); + + /** + * @param info Response info struct containing response type, serial no. and error + * + * Valid errors returned: + * RadioError:NONE + * RadioError:INVALID_ARGUMENTS + * RadioError:RADIO_NOT_AVAILABLE + * RadioError:INTERNAL_ERR + */ + oneway setLinkCapacityReportingCriteriaResponse(RadioResponseInfo info); }; diff --git a/radio/1.2/types.hal b/radio/1.2/types.hal index 3aa24460de..ca701bf7bb 100644 --- a/radio/1.2/types.hal +++ b/radio/1.2/types.hal @@ -64,6 +64,46 @@ enum IncrementalResultsPeriodicityRange : int32_t { MAX = 10, }; +/** + * Overwritten from @1.0::IndicationFilter in order to redefine ALL. In the future, this should + * be extended instead of overwritten. + */ +enum IndicationFilter : int32_t { + NONE = 0, + ALL = ~0, + /** + * When this bit is set, modem must send the signal strength update through + * IRadioIndication.currentSignalStrength() when all criteria specified by + * IRadio.setSignalStrengthReportingCriteria() are met. + */ + SIGNAL_STRENGTH = 1 << 0, + /** + * When this bit is set, modem must invoke IRadioIndication.networkStateChanged() when any field + * in VoiceRegStateResult or DataRegStateResult changes. When this bit is not set, modem must + * suppress IRadioIndication.networkStateChanged() when there are only changes from + * insignificant fields. Modem must invoke IRadioIndication.networkStateChanged() when + * significant fields are updated regardless of whether this bit is set. + * + * The following fields are considered significant: VoiceRegStateResult.regState, + * VoiceRegStateResult.rat, DataRegStateResult.regState, DataRegStateResult.rat. + */ + FULL_NETWORK_STATE = 1 << 1, + /** + * When this bit is set, modem must send IRadioIndication.dataCallListChanged() whenever any + * field in ITypes.SetupDataCallResult changes. When this bit is not set, modem must suppress + * the indication when the only changed field is 'active' (for data dormancy). For all other + * field changes, the modem must send IRadioIndication.dataCallListChanged() regardless of + * whether this bit is set. + */ + DATA_CALL_DORMANCY_CHANGED = 1 << 2, + /** + * When this bit is set, modem must send the link capacity update through + * IRadioIndication.currentLinkCapacityEstimate() when all criteria specified by + * IRadio.setLinkCapacityReportingCriteria() are met. + */ + LINK_CAPACITY_ESTIMATE = 1 << 3, +}; + struct NetworkScanRequest { ScanType type; @@ -244,3 +284,14 @@ struct CardStatus { */ string iccid; }; + +struct LinkCapacityEstimate { + /** + * Estimated downlink capacity in kbps. + */ + uint32_t downlinkCapacityKbps; + /** + * Estimated uplink capacity in kbps. + */ + uint32_t uplinkCapacityKbps; +};