Merge "HAL changes for 1.5 setLinkCapacityReportingCriteria"

This commit is contained in:
Sarah Chin 2020-02-24 23:32:55 +00:00 committed by Gerrit Code Review
commit f595ab64ca
7 changed files with 147 additions and 4 deletions

View file

@ -637,10 +637,10 @@ a64467bae843569f0d465c5be7f0c7a5b987985b55a3ef4794dd5afc68538650 android.hardwar
619fc9839ec6e369cfa9b28e3e9412e6885720ff8f9b5750c1b6ffb905120391 android.hardware.wifi.supplicant@1.3::ISupplicantStaIfaceCallback
c9273429fcf98d797d3bb07fdba6f1be95bf960f9255cde169fd1ca4db85f856 android.hardware.wifi.supplicant@1.3::ISupplicantStaNetwork
9b0a3ab6f4f74b971ed094426d8a443e29b512ff03e1ab50c07156396cdb2483 android.hardware.wifi.supplicant@1.3::types
88fb40d98b89cfaafad33b06c95e5dcd51c4470962e8fbe80ed22884407f98a1 android.hardware.radio@1.5::types
8062d0a1a03594dd8b448adcf6f08856b5720f7e33f9b785a21d3ef74a4f211d android.hardware.radio@1.5::IRadio
85af67af743b8cebb65023f196ee3df0e57b88c84d048f40439e98f845bab3d6 android.hardware.radio@1.5::types
7fefa2cc5b3b3be10b5cff5c5dc195385f491d4bf23ca65f9c6b3c30c8753a33 android.hardware.radio@1.5::IRadio
e96ae1c3a9c0689002ec2318e9c587f4f607c16a75a3cd38788b77eb91072021 android.hardware.radio@1.5::IRadioIndication
7f2439b48bda2961c6d629d0415eee66d519142cf9537f05e9d285153c70ca85 android.hardware.radio@1.5::IRadioResponse
6759e59cef81b5e15137bf99a4cd14236ce0c2974dd307ada265b67e819b9060 android.hardware.radio@1.5::IRadioResponse
dcc8872337f0135e81970e1d8d5fd7139160dc80e9be76f0ae05290fa7e472b8 android.hardware.radio.config@1.3::types
a2977755bc5f1ef47f04b7f2400632efda6218e1515dba847da487145cfabc4f android.hardware.radio.config@1.3::IRadioConfig
742360c775313438b0f82256eac62fb5bbc76a6ae6f388573f3aa142fb2c1eea android.hardware.radio.config@1.3::IRadioConfigIndication

View file

@ -68,6 +68,35 @@ interface IRadio extends @1.4::IRadio {
oneway setSignalStrengthReportingCriteria_1_5(int32_t serial,
SignalThresholdInfo signalThresholdInfo, AccessNetwork accessNetwork);
/**
* 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_1_5().
*
* @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 accessNetwork The type of network for which to apply these thresholds.
*/
oneway setLinkCapacityReportingCriteria_1_5(int32_t serial, int32_t hysteresisMs,
int32_t hysteresisDlKbps, int32_t hysteresisUlKbps, vec<int32_t> thresholdsDownlinkKbps,
vec<int32_t> thresholdsUplinkKbps, AccessNetwork accessNetwork);
/**
* Enable or disable UiccApplications on the SIM. If disabled:
* - Modem will not register on any network.

View file

@ -39,6 +39,17 @@ interface IRadioResponse extends @1.4::IRadioResponse {
*/
oneway setSignalStrengthReportingCriteriaResponse_1_5(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_1_5(RadioResponseInfo info);
/**
* @param info Response info struct containing response type, serial no. and error
*

View file

@ -156,7 +156,8 @@ struct SignalThresholdInfo {
enum AccessNetwork : @1.4::AccessNetwork {
/**
* Next-Generation Radio Access Network (NGRAN)
* Next-Generation Radio Access Network (NGRAN).
* Note NGRAN is only for standalone mode. Non-standalone mode uses AccessNetwork EUTRAN.
*/
NGRAN = 6,
};

View file

@ -309,6 +309,99 @@ TEST_F(RadioHidlTest_v1_5, setSignalStrengthReportingCriteria_1_5_NGRAN_SSSINR)
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, {RadioError::NONE}));
}
/*
* Test IRadio.setLinkCapacityReportingCriteria_1_5() invalid hysteresisDlKbps
*/
TEST_F(RadioHidlTest_v1_5, setLinkCapacityReportingCriteria_1_5_invalidHysteresisDlKbps) {
serial = GetRandomSerialNumber();
Return<void> res = radio_v1_5->setLinkCapacityReportingCriteria_1_5(
serial, 5000,
5000, // hysteresisDlKbps too big for thresholds delta
100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
::android::hardware::radio::V1_5::AccessNetwork::GERAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_5->rspInfo.serial);
ALOGI("setLinkCapacityReportingCriteria_1_5_invalidHysteresisDlKbps, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
// Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria_1_5() may not be supported
// for GERAN
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
* Test IRadio.setLinkCapacityReportingCriteria_1_5() invalid hysteresisUlKbps
*/
TEST_F(RadioHidlTest_v1_5, setLinkCapacityReportingCriteria_1_5_invalidHysteresisUlKbps) {
serial = GetRandomSerialNumber();
Return<void> res = radio_v1_5->setLinkCapacityReportingCriteria_1_5(
serial, 5000, 500,
1000, // hysteresisUlKbps too big for thresholds delta
{1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
::android::hardware::radio::V1_5::AccessNetwork::GERAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_5->rspInfo.serial);
ALOGI("setLinkCapacityReportingCriteria_1_5_invalidHysteresisUlKbps, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
// Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria_1_5() may not be supported
// for GERAN
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
* Test IRadio.setLinkCapacityReportingCriteria_1_5() empty params
*/
TEST_F(RadioHidlTest_v1_5, setLinkCapacityReportingCriteria_1_5_emptyParams) {
serial = GetRandomSerialNumber();
Return<void> res = radio_v1_5->setLinkCapacityReportingCriteria_1_5(
serial, 0, 0, 0, {}, {}, ::android::hardware::radio::V1_5::AccessNetwork::GERAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_5->rspInfo.serial);
ALOGI("setLinkCapacityReportingCriteria_1_5_emptyParams, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
// Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria_1_5() may not be supported
// for GERAN
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
* Test IRadio.setLinkCapacityReportingCriteria_1_5() for GERAN
*/
TEST_F(RadioHidlTest_v1_5, setLinkCapacityReportingCriteria_1_5_Geran) {
serial = GetRandomSerialNumber();
Return<void> res = radio_v1_5->setLinkCapacityReportingCriteria_1_5(
serial, 5000, 500, 100, {1000, 5000, 10000, 20000}, {500, 1000, 5000, 10000},
::android::hardware::radio::V1_5::AccessNetwork::GERAN);
ASSERT_OK(res);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_5->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_5->rspInfo.serial);
ALOGI("setLinkCapacityReportingCriteria_1_5_Geran, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
// Allow REQUEST_NOT_SUPPORTED as setLinkCapacityReportingCriteria_1_5() may not be supported
// for GERAN
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
* Test IRadio.enableUiccApplications() for the response returned.
* For SIM ABSENT case.

View file

@ -531,6 +531,8 @@ class RadioResponse_v1_5 : public ::android::hardware::radio::V1_5::IRadioRespon
/* 1.5 Api */
Return<void> setSignalStrengthReportingCriteriaResponse_1_5(const RadioResponseInfo& info);
Return<void> setLinkCapacityReportingCriteriaResponse_1_5(const RadioResponseInfo& info);
Return<void> enableUiccApplicationsResponse(const RadioResponseInfo& info);
Return<void> areUiccApplicationsEnabledResponse(const RadioResponseInfo& info, bool enabled);

View file

@ -894,6 +894,13 @@ Return<void> RadioResponse_v1_5::setSignalStrengthReportingCriteriaResponse_1_5(
return Void();
}
Return<void> RadioResponse_v1_5::setLinkCapacityReportingCriteriaResponse_1_5(
const RadioResponseInfo& info) {
rspInfo = info;
parent_v1_5.notify(info.serial);
return Void();
}
Return<void> RadioResponse_v1_5::enableUiccApplicationsResponse(const RadioResponseInfo& info) {
rspInfo = info;
parent_v1_5.notify(info.serial);