summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLes Lee <lesl@google.com>2020-02-27 07:18:33 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-02-27 07:18:33 +0000
commita7be1ddb384f6e21a815e469d0fb9be1ffefaaad (patch)
tree866b4eb9ea90d0ef02da8bc90a5724e14415841c /tests
parent3877359c5416e9444743c493959ca425bce87346 (diff)
parentc9f4fb984a68a23475b9b39dc25f9f6b2408fc51 (diff)
Merge "wifi: Change framework channel selection to high band channel prefer" into rvc-dev
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/util/ApConfigUtilTest.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/util/ApConfigUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/ApConfigUtilTest.java
index 19952c48e..dafc69603 100644
--- a/tests/wifitests/src/com/android/server/wifi/util/ApConfigUtilTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/util/ApConfigUtilTest.java
@@ -341,6 +341,27 @@ public class ApConfigUtilTest extends WifiBaseTest {
}
/**
+ * Verify chooseApChannel will select high band channel.
+ */
+ @Test
+ public void chooseApChannelWillHighBandPrefer() throws Exception {
+ when(mResources.getString(R.string.config_wifiSoftap2gChannelList))
+ .thenReturn("1, 6, 11");
+ when(mWifiNative.getChannelsForBand(WifiScanner.WIFI_BAND_24_GHZ))
+ .thenReturn(ALLOWED_2G_FREQS); // ch#11
+ when(mResources.getString(R.string.config_wifiSoftap5gChannelList))
+ .thenReturn("149, 153");
+ when(mWifiNative.getChannelsForBand(WifiScanner.WIFI_BAND_5_GHZ))
+ .thenReturn(ALLOWED_5G_FREQS); //ch# 149, 153
+
+ int freq = ApConfigUtil.chooseApChannel(
+ SoftApConfiguration.BAND_2GHZ | SoftApConfiguration.BAND_5GHZ,
+ mWifiNative, mResources);
+ assertTrue(ArrayUtils.contains(ALLOWED_5G_FREQS, freq));
+ }
+
+
+ /**
* Verify default band and channel is used when HAL support is
* not available.
*/