diff options
author | lesl <lesl@google.com> | 2020-02-21 18:04:51 +0800 |
---|---|---|
committer | Les Lee <lesl@google.com> | 2020-02-24 06:28:50 +0000 |
commit | c9f4fb984a68a23475b9b39dc25f9f6b2408fc51 (patch) | |
tree | c1b16412f1d48b299a7fc63cdab9c55788aec4bb /tests | |
parent | 3f287f8eef3cec1f09a2e68d40ebc77a7b7f3e70 (diff) |
wifi: Change framework channel selection to high band channel prefer
Test: atest frameworks/opt/net/wifi/tests/wifitests/
Test: Manual test to switch band setting between 2.4G and 5G prefer,
check log to make sure the behavior.
Bug: 149974192
Merged-In: Id6a625d733a4549f03a67f398ac6a66734575459
Change-Id: Id6a625d733a4549f03a67f398ac6a66734575459
(cherry picked from commit faed97a0b7891c4a704b60edc8715663081b26bc)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/util/ApConfigUtilTest.java | 21 |
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. */ |