Add HAL for 5G bands

am: b7709bba42

Change-Id: I2a8a429c94ff3d27d8cdb2f3a1eced7867d0dcda
This commit is contained in:
Sarah Chin 2019-12-05 13:48:55 -08:00 committed by android-build-merger
commit 5f2f5fa8f3
8 changed files with 636 additions and 7 deletions

View file

@ -604,12 +604,11 @@ 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
274fb1254a6d1a97824ec5c880eeefc0e410dc6d3a2a4c34052201169d2b7de0 android.hardware.radio@1.5::types
4c666aaf3944ad91c2428b8456d0db4a2f81191f8c294f046a2f539e9fc7b6fd android.hardware.radio@1.5::IRadio
521d1fe5b9f212b7b37ab71c0d33f5d2622618837e318e99a80d882f186af6b9 android.hardware.radio@1.5::types
3f1e2410d9bed4e7d41c6a589fe3a7943bc904b0066e40e0199a7c58427ac4e9 android.hardware.radio@1.5::IRadio
3afac66f21a33bc9c4b80481c7d5540038348651d9a7d8af64ea13610af138da android.hardware.radio@1.5::IRadioIndication
70e977f2ccefd2e503bedb3a66313639b53fbc7bde025538b07f41e2292b6624 android.hardware.radio@1.5::IRadioResponse
caf00e0d942b77b17d7061b38de11e5b19e1da90d4818434cb4916ba89e30686 android.hardware.radio@1.5::IRadioResponse
55f0a15642869ec98a55ea0a5ac049d3e1a6245ff7750deb6bcb7182057eee83 android.hardware.radio.config@1.3::types
b27ab0cd40b0b078cdcd024bfe1061c4c4c065f3519eeb9347fa359a3268a5ae android.hardware.radio.config@1.3::IRadioConfig
742360c775313438b0f82256eac62fb5bbc76a6ae6f388573f3aa142fb2c1eea android.hardware.radio.config@1.3::IRadioConfigIndication
7683fed9d253956071f18b152e6be657719536f98d9b534433d5e411bcde5061 android.hardware.radio.config@1.3::IRadioConfigResponse

View file

@ -18,6 +18,8 @@ package android.hardware.radio@1.5;
import @1.4::IRadio;
import @1.5::AccessNetwork;
import @1.5::NetworkScanRequest;
import @1.5::RadioAccessSpecifier;
import @1.5::SignalThresholdInfo;
/**
@ -29,7 +31,6 @@ import @1.5::SignalThresholdInfo;
* setResponseFunctions must work with @1.5::IRadioResponse and @1.5::IRadioIndication.
*/
interface IRadio extends @1.4::IRadio {
/**
* Sets the signal strength reporting criteria.
*
@ -96,4 +97,32 @@ interface IRadio extends @1.4::IRadio {
* Response callback is IRadioResponse.canToggleUiccApplicationsEnablementResponse()
*/
oneway canToggleUiccApplicationsEnablement(int32_t serial);
/**
* Specify which bands modem's background scan must act on.
* If specifyChannels is true, it only scans bands specified in specifiers.
* If specifyChannels is false, it scans all bands.
*
* For example, CBRS is only on LTE band 48. By specifying this band,
* modem saves more power.
*
* @param serial Serial number of request.
* @param specifyChannels whether to scan bands defined in specifiers.
* @param specifiers which bands to scan. Only used if specifyChannels is true.
*
* Response callback is IRadioResponse.setSystemSelectionChannelsResponse()
*/
oneway setSystemSelectionChannels_1_5(int32_t serial, bool specifyChannels,
vec<RadioAccessSpecifier> specifiers);
/**
* Starts a network scan
*
* @param serial Serial number of request.
* @param request Defines the radio networks/bands/channels which need to be scanned.
*
* Same API as @1.4::IRadio.startNetworkScan_1_4, except using
* 1.5 version of NetworkScanRequest
*/
oneway startNetworkScan_1_5(int32_t serial, NetworkScanRequest request);
};

View file

@ -69,4 +69,28 @@ interface IRadioResponse extends @1.4::IRadioResponse {
* RadioError:INTERNAL_ERR
*/
oneway canToggleUiccApplicationsEnablementResponse(RadioResponseInfo info, bool canToggle);
/**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
* RadioError:INVALID_ARGUMENTS
*/
oneway setSystemSelectionChannelsResponse_1_5(RadioResponseInfo info);
/**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:DEVICE_IN_USE
* RadioError:INTERNAL_ERR
* RadioError:MODEM_ERR
* RadioError:INVALID_ARGUMENTS
*/
oneway startNetworkScanResponse_1_5(RadioResponseInfo info);
};

View file

@ -16,6 +16,13 @@
package android.hardware.radio@1.5;
import @1.1::EutranBands;
import @1.1::GeranBands;
import @1.1::RadioAccessNetworks;
import @1.1::RadioAccessSpecifier;
import @1.1::ScanType;
import @1.1::UtranBands;
import @1.2::NetworkScanRequest;
import @1.4::AccessNetwork;
/**
@ -114,3 +121,134 @@ enum AccessNetwork : @1.4::AccessNetwork {
*/
NGRAN = 6,
};
enum RadioAccessNetworks : @1.1::RadioAccessNetworks {
NGRAN = 4,
};
/**
* Overwritten from @1.1::RadioAccessSpecifier to add NGRAN and NgranBands
*/
struct RadioAccessSpecifier {
/**
* The type of network to scan.
*/
RadioAccessNetworks radioAccessNetwork;
/**
* The frequency bands to scan.
* Maximum length of the vector is 8.
*/
safe_union Bands {
/** Valid only if radioAccessNetwork = GERAN. */
vec<GeranBands> geranBands;
/** Valid only if radioAccessNetwork = UTRAN. */
vec<UtranBands> utranBands;
/** Valid only if radioAccessNetwork = EUTRAN. */
vec<EutranBands> eutranBands;
/** Valid only if radioAccessNetwork = NGRAN. */
vec<NgranBands> ngranBands;
} bands;
/**
* The radio channels to scan as defined in 3GPP TS 25.101 and 36.101.
* Maximum length of the vector is 32.
*/
vec<int32_t> channels;
};
enum NgranBands : int32_t {
/** 3GPP TS 28.101-1, Table 5.2-1: FR1 bands */
BAND_1 = 1,
BAND_2 = 2,
BAND_3 = 3,
BAND_5 = 5,
BAND_7 = 7,
BAND_8 = 8,
BAND_12 = 12,
BAND_20 = 20,
BAND_25 = 25,
BAND_28 = 28,
BAND_34 = 34,
BAND_38 = 38,
BAND_39 = 39,
BAND_40 = 40,
BAND_41 = 41,
BAND_50 = 50,
BAND_51 = 51,
BAND_66 = 66,
BAND_70 = 70,
BAND_71 = 71,
BAND_74 = 74,
BAND_75 = 75,
BAND_76 = 76,
BAND_77 = 77,
BAND_78 = 78,
BAND_79 = 79,
BAND_80 = 80,
BAND_81 = 81,
BAND_82 = 82,
BAND_83 = 83,
BAND_84 = 84,
BAND_86 = 86,
/** 3GPP TS 28.101-2, Table 5.2-1: FR2 bands */
BAND_257 = 257,
BAND_258 = 258,
BAND_260 = 260,
BAND_261 = 261,
};
/**
* Overwritten from @1.2::NetworkScanRequest to update
* RadioAccessSpecifier to 1.5 version
*/
struct NetworkScanRequest {
ScanType type;
/**
* Time interval in seconds between the completion of one scan and the start of
* a subsequent scan.
* Implementations may ignore this field unless the 'type' is 'PERIODIC'.
* Range: ScanIntervalRange:MIN to ScanIntervalRange:MAX
*/
int32_t interval;
/**
* Networks with bands/channels to scan
* Maximum length of the vector is RadioConst:RADIO_ACCESS_SPECIFIER_MAX_SIZE
*/
vec<RadioAccessSpecifier> specifiers;
/**
* Maximum duration of the periodic search (in seconds).
* If the search lasts maxSearchTime, it must be terminated.
* Range: MaxSearchTimeRange:MIN to MaxSearchTimeRange:MAX
*/
int32_t maxSearchTime;
/**
* Indicates whether the modem must report incremental results of the network scan
* to the client.
* FALSE Incremental results must not be reported.
* TRUE Incremental must be reported.
*/
bool incrementalResults;
/**
* Indicates the periodicity with which the modem must report incremental results to
* the client (in seconds).
* Implementations may ignore this value if the incremental results are not requested.
* This value must be less than or equal to maxSearchTime.
* Range: IncrementalResultsPeriodicityRange:MIN to IncrementalResultsPeriodicityRange:MAX
*/
int32_t incrementalResultsPeriodicity;
/**
* Describes the List of PLMN ids (MCC-MNC)
* If any PLMN of this list is found, search must end at that point and results with all
* PLMN found until that point should be sent as response.
* If the list is not sent, search to be completed until end and all PLMNs found to be
* reported.
*/
vec<string> mccMncs;
};

View file

@ -23,4 +23,4 @@ int main(int argc, char** argv) {
int status = RUN_ALL_TESTS();
LOG(INFO) << "Test result = " << status;
return status;
}
}

View file

@ -446,3 +446,422 @@ TEST_F(RadioHidlTest_v1_5, areUiccApplicationsEnabled) {
EXPECT_EQ(RadioError::NONE, radioRsp_v1_5->rspInfo.error);
}
}
/*
* Test IRadio.setSystemSelectionChannels_1_5() for the response returned.
*/
TEST_F(RadioHidlTest_v1_5, setSystemSelectionChannels_1_5) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
Return<void> res = radio_v1_5->setSystemSelectionChannels_1_5(serial, true, {specifier});
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("setSystemSelectionChannels, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR}));
if (radioRsp_v1_5->rspInfo.error == RadioError::NONE) {
serial = GetRandomSerialNumber();
Return<void> res = radio_v1_5->setSystemSelectionChannels_1_5(serial, false, {specifier});
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("setSystemSelectionChannels, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
EXPECT_EQ(RadioError::NONE, radioRsp_v1_5->rspInfo.error);
}
}
/*
* Test IRadio.startNetworkScan_1_5() for the response returned.
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan, rspInfo.error = %s\n", toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, {RadioError::SIM_ABSENT}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
// OPERATION_NOT_ALLOWED should not be allowed; however, some vendors do
// not support the required manual GSM search functionality. This is
// tracked in b/112206766. Modems have "GSM" rat scan need to
// support scanning requests combined with some parameters.
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid specifier.
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidArgument) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::NetworkScanRequest request = {.type = ScanType::ONE_SHOT,
.interval = 60};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidArgument, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid interval (lower boundary).
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidInterval1) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 4,
.specifiers = {specifier},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidInterval1, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid interval (upper boundary).
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidInterval2) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 301,
.specifiers = {specifier},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidInterval2, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid max search time (lower boundary).
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidMaxSearchTime1) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 59,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidMaxSearchTime1, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid max search time (upper boundary).
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidMaxSearchTime2) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 3601,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidMaxSearchTime2, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid periodicity (lower boundary).
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidPeriodicity1) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 600,
.incrementalResults = true,
.incrementalResultsPeriodicity = 0};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidPeriodicity1, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with invalid periodicity (upper boundary).
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_InvalidPeriodicity2) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 600,
.incrementalResults = true,
.incrementalResultsPeriodicity = 11};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_InvalidPeriodicity2, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::SIM_ABSENT, RadioError::INVALID_ARGUMENTS}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_v1_5->rspInfo.error,
{RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with valid periodicity
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_GoodRequest1) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 360,
.incrementalResults = false,
.incrementalResultsPeriodicity = 10};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_GoodRequest1, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::SIM_ABSENT}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::INVALID_ARGUMENTS,
RadioError::REQUEST_NOT_SUPPORTED}));
}
}
/*
* Test IRadio.startNetworkScan_1_5() with valid periodicity and plmns
*/
TEST_F(RadioHidlTest_v1_5, startNetworkScan_GoodRequest2) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands rasBands;
rasBands.geranBands() = {GeranBands::BAND_450, GeranBands::BAND_480};
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
.bands = rasBands,
.channels = {1, 2}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
.specifiers = {specifier},
.maxSearchTime = 360,
.incrementalResults = false,
.incrementalResultsPeriodicity = 10,
.mccMncs = {"310410"}};
Return<void> res = radio_v1_5->startNetworkScan_1_5(serial, request);
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("startNetworkScan_GoodRequest2, rspInfo.error = %s\n",
toString(radioRsp_v1_5->rspInfo.error).c_str());
if (cardStatus.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::SIM_ABSENT}));
} else if (cardStatus.base.base.cardState == CardState::PRESENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
{RadioError::NONE, RadioError::INVALID_ARGUMENTS,
RadioError::REQUEST_NOT_SUPPORTED}));
}
}

View file

@ -53,7 +53,7 @@ using ::android::hardware::Void;
class RadioHidlTest_v1_5;
extern ::android::hardware::radio::V1_4::CardStatus cardStatus;
/* Callback class for radio respons v1_5 */
/* Callback class for radio response v1_5 */
class RadioResponse_v1_5 : public ::android::hardware::radio::V1_5::IRadioResponse {
protected:
RadioHidlTest_v1_5& parent_v1_5;
@ -530,10 +530,17 @@ class RadioResponse_v1_5 : public ::android::hardware::radio::V1_5::IRadioRespon
/* 1.5 Api */
Return<void> setSignalStrengthReportingCriteriaResponse_1_5(const RadioResponseInfo& info);
Return<void> enableUiccApplicationsResponse(const RadioResponseInfo& info);
Return<void> areUiccApplicationsEnabledResponse(const RadioResponseInfo& info, bool enabled);
Return<void> canToggleUiccApplicationsEnablementResponse(const RadioResponseInfo& info,
bool canToggle);
Return<void> setSystemSelectionChannelsResponse_1_5(const RadioResponseInfo& info);
Return<void> startNetworkScanResponse_1_5(const RadioResponseInfo& info);
};
/* Callback class for radio indication */

View file

@ -915,3 +915,16 @@ Return<void> RadioResponse_v1_5::canToggleUiccApplicationsEnablementResponse(
parent_v1_5.notify(info.serial);
return Void();
}
Return<void> RadioResponse_v1_5::setSystemSelectionChannelsResponse_1_5(
const RadioResponseInfo& info) {
rspInfo = info;
parent_v1_5.notify(info.serial);
return Void();
}
Return<void> RadioResponse_v1_5::startNetworkScanResponse_1_5(const RadioResponseInfo& info) {
rspInfo = info;
parent_v1_5.notify(info.serial);
return Void();
}