Merge "Adds VTS test for getAllowedNetworkTypesBitmap" into sc-dev am: 8f1245a802 am: 374dbbf641

Original change: https://googleplex-android-review.googlesource.com/c/platform/hardware/interfaces/+/14925197

Change-Id: I86d57a112a8b926beca5d01690a86f9792faa73f
This commit is contained in:
Yomna Nasser 2021-06-17 17:47:19 +00:00 committed by Automerger Merge Worker
commit b66adf246c
2 changed files with 48 additions and 2 deletions

View file

@ -51,6 +51,49 @@ TEST_P(RadioHidlTest_v1_6, setAllowedNetworkTypesBitmap) {
}
}
/*
* Test IRadio.getAllowedNetworkTypesBitmap for the response returned.
*/
TEST_P(RadioHidlTest_v1_6, getAllowedNetworkTypesBitmap) {
serial = GetRandomSerialNumber();
::android::hardware::hidl_bitfield<::android::hardware::radio::V1_4::RadioAccessFamily>
allowedNetworkTypesBitmap{};
allowedNetworkTypesBitmap |= ::android::hardware::radio::V1_4::RadioAccessFamily::LTE;
radio_v1_6->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
if (radioRsp_v1_6->rspInfo.error == ::android::hardware::radio::V1_6::RadioError::NONE) {
sleep(3); // wait for modem
serial = GetRandomSerialNumber();
radio_v1_6->getAllowedNetworkTypesBitmap(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_v1_6->rspInfo.type);
EXPECT_EQ(serial, radioRsp_v1_6->rspInfo.serial);
if (getRadioHalCapabilities()) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
{::android::hardware::radio::V1_6::RadioError::REQUEST_NOT_SUPPORTED}));
} else {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_6->rspInfo.error,
{::android::hardware::radio::V1_6::RadioError::NONE,
::android::hardware::radio::V1_6::RadioError::RADIO_NOT_AVAILABLE,
::android::hardware::radio::V1_6::RadioError::OPERATION_NOT_ALLOWED,
::android::hardware::radio::V1_6::RadioError::MODE_NOT_SUPPORTED,
::android::hardware::radio::V1_6::RadioError::INTERNAL_ERR,
::android::hardware::radio::V1_6::RadioError::INVALID_ARGUMENTS,
::android::hardware::radio::V1_6::RadioError::MODEM_ERR,
::android::hardware::radio::V1_6::RadioError::NO_RESOURCES}));
}
}
}
/*
* Test IRadio.setupDataCall_1_6() for the response returned.
*/

View file

@ -1172,10 +1172,13 @@ Return<void> RadioResponse_v1_6::setAllowedNetworkTypesBitmapResponse(
}
Return<void> RadioResponse_v1_6::getAllowedNetworkTypesBitmapResponse(
const ::android::hardware::radio::V1_6::RadioResponseInfo& /*info*/,
const ::android::hardware::radio::V1_6::RadioResponseInfo& info,
const ::android::hardware::hidl_bitfield<
::android::hardware::radio::V1_4::RadioAccessFamily>
/*networkTypeBitmap*/) {
networkTypeBitmap) {
rspInfo = info;
networkTypeBitmapResponse = networkTypeBitmap;
parent_v1_6.notify(info.serial);
return Void();
}