Merge "Use Widely Supported GSM Channels for NetworkScan"
This commit is contained in:
commit
6f337cc82b
1 changed files with 65 additions and 99 deletions
|
@ -19,19 +19,25 @@
|
|||
|
||||
#define ASSERT_OK(ret) ASSERT_TRUE(ret.isOk())
|
||||
|
||||
namespace {
|
||||
const RadioAccessSpecifier GERAN_SPECIFIER_P900 = {.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_P900},
|
||||
.channels = {512, 513}};
|
||||
const RadioAccessSpecifier GERAN_SPECIFIER_850 = {.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_850},
|
||||
.channels = {128, 129}};
|
||||
} // namespace
|
||||
|
||||
/*
|
||||
* Test IRadio.startNetworkScan() for the response returned.
|
||||
*/
|
||||
TEST_F(RadioHidlTest_v1_2, startNetworkScan) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT, .interval = 60, .specifiers = {specifier}};
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850}};
|
||||
|
||||
Return<void> res = radio_v1_2->startNetworkScan_1_2(serial, request);
|
||||
ASSERT_OK(res);
|
||||
|
@ -89,15 +95,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidArgument) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval1) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 4,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
.maxSearchTime = 60,
|
||||
.incrementalResults = false,
|
||||
.incrementalResultsPeriodicity = 1};
|
||||
|
@ -126,15 +127,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval1) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval2) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 301,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
.maxSearchTime = 60,
|
||||
.incrementalResults = false,
|
||||
.incrementalResultsPeriodicity = 1};
|
||||
|
@ -163,15 +159,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidInterval2) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime1) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
.maxSearchTime = 59,
|
||||
.incrementalResults = false,
|
||||
.incrementalResultsPeriodicity = 1};
|
||||
|
@ -200,15 +191,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime1) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime2) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
.maxSearchTime = 3601,
|
||||
.incrementalResults = false,
|
||||
.incrementalResultsPeriodicity = 1};
|
||||
|
@ -237,15 +223,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidMaxSearchTime2) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity1) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
.maxSearchTime = 600,
|
||||
.incrementalResults = false,
|
||||
.incrementalResultsPeriodicity = 0};
|
||||
|
@ -274,15 +255,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity1) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity2) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
.maxSearchTime = 600,
|
||||
.incrementalResults = false,
|
||||
.incrementalResultsPeriodicity = 11};
|
||||
|
@ -311,15 +287,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_InvalidPeriodicity2) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest1) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
// Some vendor may not support max search time of 360s.
|
||||
// This issue is tracked in b/112205669.
|
||||
.maxSearchTime = 300,
|
||||
|
@ -350,15 +321,10 @@ TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest1) {
|
|||
TEST_F(RadioHidlTest_v1_2, startNetworkScan_GoodRequest2) {
|
||||
serial = GetRandomSerialNumber();
|
||||
|
||||
RadioAccessSpecifier specifier = {
|
||||
.radioAccessNetwork = RadioAccessNetworks::GERAN,
|
||||
.geranBands = {GeranBands::BAND_450, GeranBands::BAND_480},
|
||||
.channels = {1,2}};
|
||||
|
||||
::android::hardware::radio::V1_2::NetworkScanRequest request = {
|
||||
.type = ScanType::ONE_SHOT,
|
||||
.interval = 60,
|
||||
.specifiers = {specifier},
|
||||
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
|
||||
// Some vendor may not support max search time of 360s.
|
||||
// This issue is tracked in b/112205669.
|
||||
.maxSearchTime = 300,
|
||||
|
|
Loading…
Reference in a new issue