diff options
author | Ahmed ElArabawy <arabawy@google.com> | 2020-05-13 04:40:48 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-05-13 04:40:48 +0000 |
commit | e6653aa67eb3995ad912958619aaa4fec78a74e5 (patch) | |
tree | 1bf7f06a6741c1b07cd71ff9cee41f745cf357ea | |
parent | 5ea8ed1787d92bce3b07c049e9917cbd6bfc39ef (diff) | |
parent | e3da880a84385b8ac304b9e08d6bb5551db56628 (diff) |
Merge "Include 6GHz band in scanning" into rvc-dev
15 files changed, 58 insertions, 64 deletions
diff --git a/service/java/com/android/server/wifi/ScanRequestProxy.java b/service/java/com/android/server/wifi/ScanRequestProxy.java index ce6a4a422..c054b90a4 100644 --- a/service/java/com/android/server/wifi/ScanRequestProxy.java +++ b/service/java/com/android/server/wifi/ScanRequestProxy.java @@ -139,7 +139,7 @@ public class ScanRequestProxy { Log.d(TAG, "Received " + scanResults.length + " scan results"); } // Only process full band scan results. - if (scanData.getBandScanned() == WifiScanner.WIFI_BAND_BOTH_WITH_DFS) { + if (WifiScanner.isFullBandScan(scanData.getBandScanned(), false)) { // Store the last scan results & send out the scan completion broadcast. mLastScanResults.clear(); mLastScanResults.addAll(Arrays.asList(scanResults)); @@ -442,7 +442,7 @@ public class ScanRequestProxy { settings.type = WifiScanner.SCAN_TYPE_HIGH_ACCURACY; } // always do full scans - settings.band = WifiScanner.WIFI_BAND_BOTH_WITH_DFS; + settings.band = WifiScanner.WIFI_BAND_ALL; settings.reportEvents = WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN | WifiScanner.REPORT_EVENT_FULL_SCAN_RESULT; if (mScanningForHiddenNetworksEnabled) { diff --git a/service/java/com/android/server/wifi/WakeupController.java b/service/java/com/android/server/wifi/WakeupController.java index 1da8fe58a..b003b74b9 100644 --- a/service/java/com/android/server/wifi/WakeupController.java +++ b/service/java/com/android/server/wifi/WakeupController.java @@ -74,10 +74,8 @@ public class WakeupController { @Override public void onResults(WifiScanner.ScanData[] results) { // We treat any full band scans (with DFS or not) as "full". - boolean isFullBandScanResults = - results[0].getBandScanned() == WifiScanner.WIFI_BAND_BOTH_WITH_DFS - || results[0].getBandScanned() == WifiScanner.WIFI_BAND_BOTH; - if (results.length == 1 && isFullBandScanResults) { + if (results.length == 1 + && WifiScanner.isFullBandScan(results[0].getBandScanned(), true)) { handleScanResults(filterDfsScanResults(Arrays.asList(results[0].getResults()))); } } diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java index 975d446ea..ed647cb69 100644 --- a/service/java/com/android/server/wifi/WifiConnectivityManager.java +++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java @@ -492,9 +492,11 @@ public class WifiConnectivityManager { } // We treat any full band scans (with DFS or not) as "full". - boolean isFullBandScanResults = - results[0].getBandScanned() == WifiScanner.WIFI_BAND_BOTH_WITH_DFS - || results[0].getBandScanned() == WifiScanner.WIFI_BAND_BOTH; + boolean isFullBandScanResults = false; + if (results != null && results.length > 0) { + isFullBandScanResults = + WifiScanner.isFullBandScan(results[0].getBandScanned(), true); + } // Full band scan results only. if (mWaitForFullBandScanResults) { if (!isFullBandScanResults) { @@ -505,7 +507,7 @@ public class WifiConnectivityManager { mWaitForFullBandScanResults = false; } } - if (results.length > 0) { + if (results != null && results.length > 0) { mWifiMetrics.incrementAvailableNetworksHistograms(mScanDetails, isFullBandScanResults); } @@ -966,7 +968,7 @@ public class WifiConnectivityManager { private int getScanBand(boolean isFullBandScan) { if (isFullBandScan) { - return WifiScanner.WIFI_BAND_BOTH_WITH_DFS; + return WifiScanner.WIFI_BAND_ALL; } else { // Use channel list instead. return WifiScanner.WIFI_BAND_UNSPECIFIED; diff --git a/service/java/com/android/server/wifi/WifiHealthMonitor.java b/service/java/com/android/server/wifi/WifiHealthMonitor.java index 065ef3fd0..27167dccf 100644 --- a/service/java/com/android/server/wifi/WifiHealthMonitor.java +++ b/service/java/com/android/server/wifi/WifiHealthMonitor.java @@ -1046,15 +1046,12 @@ public class WifiHealthMonitor { @Override public void onResults(WifiScanner.ScanData[] results) { - if (!mWifiEnabled) { + if (!mWifiEnabled || results == null || results.length == 0) { clearScanDetails(); return; } - boolean isFullBandScanResults = - results[0].getBandScanned() == WifiScanner.WIFI_BAND_BOTH_WITH_DFS - || results[0].getBandScanned() == WifiScanner.WIFI_BAND_BOTH; - if (isFullBandScanResults) { + if (WifiScanner.isFullBandScan(results[0].getBandScanned(), true)) { handleScanResults(mScanDetails); } clearScanDetails(); diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java index 52fc0e5a7..b47afc851 100644 --- a/service/java/com/android/server/wifi/WifiNetworkFactory.java +++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java @@ -371,7 +371,7 @@ public class WifiNetworkFactory extends NetworkFactory { // Create the scan settings. mScanSettings = new WifiScanner.ScanSettings(); mScanSettings.type = WifiScanner.SCAN_TYPE_HIGH_ACCURACY; - mScanSettings.band = WifiScanner.WIFI_BAND_BOTH_WITH_DFS; + mScanSettings.band = WifiScanner.WIFI_BAND_ALL; mScanSettings.reportEvents = WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN; mScanListener = new NetworkFactoryScanListener(); mPeriodicScanTimerListener = new PeriodicScanAlarmListener(); diff --git a/service/java/com/android/server/wifi/WifiVendorHal.java b/service/java/com/android/server/wifi/WifiVendorHal.java index d85d535fa..ed6ac7fdd 100644 --- a/service/java/com/android/server/wifi/WifiVendorHal.java +++ b/service/java/com/android/server/wifi/WifiVendorHal.java @@ -747,6 +747,9 @@ public class WifiVendorHal { /** * Makes the Hal flavor of WifiScanner's band indication * + * Note: This method is only used by background scan which does not + * support 6GHz, hence band combinations including 6GHz are considered invalid + * * @param frameworkBand one of WifiScanner.WIFI_BAND_* * @return A WifiBand value * @throws IllegalArgumentException if frameworkBand is not recognized diff --git a/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java b/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java index ec43cde6c..2de70d55e 100644 --- a/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java +++ b/service/java/com/android/server/wifi/scanner/KnownBandsChannelHelper.java @@ -20,12 +20,12 @@ import static android.net.wifi.WifiScanner.WIFI_BAND_24_GHZ; import static android.net.wifi.WifiScanner.WIFI_BAND_5_GHZ; import static android.net.wifi.WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY; import static android.net.wifi.WifiScanner.WIFI_BAND_6_GHZ; +import static android.net.wifi.WifiScanner.WIFI_BAND_ALL; import static android.net.wifi.WifiScanner.WIFI_BAND_COUNT; import static android.net.wifi.WifiScanner.WIFI_BAND_INDEX_24_GHZ; import static android.net.wifi.WifiScanner.WIFI_BAND_INDEX_5_GHZ; import static android.net.wifi.WifiScanner.WIFI_BAND_INDEX_5_GHZ_DFS_ONLY; import static android.net.wifi.WifiScanner.WIFI_BAND_INDEX_6_GHZ; -import static android.net.wifi.WifiScanner.WIFI_BAND_MAX; import static android.net.wifi.WifiScanner.WIFI_BAND_UNSPECIFIED; import android.net.wifi.ScanResult; @@ -106,7 +106,7 @@ public class KnownBandsChannelHelper extends ChannelHelper { @Override public WifiScanner.ChannelSpec[][] getAvailableScanChannels(int band) { - if (band <= WIFI_BAND_UNSPECIFIED || band >= WIFI_BAND_MAX) { + if (band <= WIFI_BAND_UNSPECIFIED || band > WIFI_BAND_ALL) { // Invalid value for band. return null; } @@ -301,7 +301,7 @@ public class KnownBandsChannelHelper extends ChannelHelper { @Override public boolean isAllChannels() { - return containsBand(WIFI_BAND_MAX - 1); + return containsBand(WIFI_BAND_ALL); } @Override @@ -369,7 +369,7 @@ public class KnownBandsChannelHelper extends ChannelHelper { @Override public Set<Integer> getScanFreqs() { - if (mExactBands == WIFI_BAND_MAX - 1) { + if (mExactBands == WIFI_BAND_ALL) { return null; } else { return new ArraySet<Integer>(mChannels); diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java index b81c842e4..716b206c3 100644 --- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java +++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java @@ -920,9 +920,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { } if (validateScanRequest(ci, handler, scanSettings)) { mWifiMetrics.incrementOneshotScanCount(); - if (scanSettings.band == WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY - || scanSettings.band == WifiScanner.WIFI_BAND_5_GHZ_WITH_DFS - || scanSettings.band == WifiScanner.WIFI_BAND_BOTH_WITH_DFS) { + if ((scanSettings.band & WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY) != 0) { mWifiMetrics.incrementOneshotScanWithDfsCount(); } logScanRequest("addSingleScanRequest", ci, handler, workSource, @@ -1283,8 +1281,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub { } // Cache full band (with DFS or not) scan results. - if (results.getBandScanned() == WifiScanner.WIFI_BAND_BOTH_WITH_DFS - || results.getBandScanned() == WifiScanner.WIFI_BAND_BOTH) { + if (WifiScanner.isFullBandScan(results.getBandScanned(), true)) { mCachedScanResults.clear(); mCachedScanResults.addAll(Arrays.asList(results.getResults())); } diff --git a/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java b/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java index 287a3e144..4a48ed252 100644 --- a/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java +++ b/service/java/com/android/server/wifi/scanner/WificondScannerImpl.java @@ -20,6 +20,7 @@ import android.app.AlarmManager; import android.content.Context; import android.net.wifi.ScanResult; import android.net.wifi.WifiScanner; +import android.net.wifi.WifiScanner.WifiBandIndex; import android.os.Handler; import android.os.Looper; import android.os.Message; @@ -344,20 +345,14 @@ public class WificondScannerImpl extends WifiScannerImpl implements Handler.Call * Return one of the WIFI_BAND_# values that was scanned for in this scan. */ private static int getBandScanned(ChannelCollection channelCollection) { - if (channelCollection.containsBand(WifiScanner.WIFI_BAND_BOTH_WITH_DFS)) { - return WifiScanner.WIFI_BAND_BOTH_WITH_DFS; - } else if (channelCollection.containsBand(WifiScanner.WIFI_BAND_BOTH)) { - return WifiScanner.WIFI_BAND_BOTH; - } else if (channelCollection.containsBand(WifiScanner.WIFI_BAND_5_GHZ_WITH_DFS)) { - return WifiScanner.WIFI_BAND_5_GHZ_WITH_DFS; - } else if (channelCollection.containsBand(WifiScanner.WIFI_BAND_5_GHZ)) { - return WifiScanner.WIFI_BAND_5_GHZ; - } else if (channelCollection.containsBand(WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY)) { - return WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY; - } else if (channelCollection.containsBand(WifiScanner.WIFI_BAND_24_GHZ)) { - return WifiScanner.WIFI_BAND_24_GHZ; + int bandScanned = WifiScanner.WIFI_BAND_UNSPECIFIED; + + for (@WifiBandIndex int i = 0; i < WifiScanner.WIFI_BAND_COUNT; i++) { + if (channelCollection.containsBand(1 << i)) { + bandScanned |= 1 << i; + } } - return WifiScanner.WIFI_BAND_UNSPECIFIED; + return bandScanned; } private void pollLatestScanData() { diff --git a/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java b/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java index e4d67eca9..b065f823c 100644 --- a/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java @@ -131,11 +131,11 @@ public class ScanRequestProxyTest extends WifiBaseTest { mTestScanDatas1 = ScanTestUtil.createScanDatas(new int[][]{{ 2417, 2427, 5180, 5170 }}, new int[]{0}, - new int[]{WifiScanner.WIFI_BAND_BOTH_WITH_DFS}); + new int[]{WifiScanner.WIFI_BAND_ALL}); mTestScanDatas2 = ScanTestUtil.createScanDatas(new int[][]{{ 2412, 2422, 5200, 5210 }}, new int[]{0}, - new int[]{WifiScanner.WIFI_BAND_BOTH_WITH_DFS}); + new int[]{WifiScanner.WIFI_BAND_ALL}); // Scan throttling is enabled by default. when(mWifiSettingsConfigStore.get(eq(WIFI_SCAN_THROTTLE_ENABLED))).thenReturn(true); @@ -866,7 +866,7 @@ public class ScanRequestProxyTest extends WifiBaseTest { boolean expectHiddenNetworks, boolean expectHighAccuracyType) { assertNotNull(scanSettings); - assertEquals(WifiScanner.WIFI_BAND_BOTH_WITH_DFS, scanSettings.band); + assertEquals(WifiScanner.WIFI_BAND_ALL, scanSettings.band); if (expectHighAccuracyType) { assertEquals(WifiScanner.SCAN_TYPE_HIGH_ACCURACY, scanSettings.type); } else { diff --git a/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java b/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java index 4b97f69f7..ed2ccce5e 100644 --- a/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WakeupControllerTest.java @@ -114,8 +114,9 @@ public class WakeupControllerTest extends WifiBaseTest { ScanResult[] scanResults = new ScanResult[1]; scanResults[0] = mTestScanResult; mTestScanDatas = new WifiScanner.ScanData[1]; + int scanBand = WifiScanner.WIFI_BAND_ALL & ~WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY; mTestScanDatas[0] = new WifiScanner.ScanData(0 /* id */, 0 /* flags */, - 0 /* bucketsScanned */, WifiScanner.WIFI_BAND_BOTH /* bandScanned */, scanResults); + 0 /* bucketsScanned */, scanBand /* bandScanned */, scanResults); } /** Initializes the wakeupcontroller in the given {@code enabled} state. */ diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java index cd9ef0243..b01f2beb1 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java @@ -259,7 +259,7 @@ public class WifiConnectivityManagerTest extends WifiBaseTest { ScanData mockScanData() { ScanData scanData = mock(ScanData.class); - when(scanData.getBandScanned()).thenReturn(WifiScanner.WIFI_BAND_BOTH_WITH_DFS); + when(scanData.getBandScanned()).thenReturn(WifiScanner.WIFI_BAND_ALL); return scanData; } @@ -1791,7 +1791,7 @@ public class WifiConnectivityManagerTest extends WifiBaseTest { doAnswer(new AnswerWithArguments() { public void answer(ScanSettings settings, ScanListener listener, WorkSource workSource) throws Exception { - assertEquals(settings.band, WifiScanner.WIFI_BAND_BOTH_WITH_DFS); + assertEquals(settings.band, WifiScanner.WIFI_BAND_ALL); assertNull(settings.channels); }}).when(mWifiScanner).startScan(anyObject(), anyObject(), anyObject()); @@ -1958,7 +1958,7 @@ public class WifiConnectivityManagerTest extends WifiBaseTest { doAnswer(new AnswerWithArguments() { public void answer(ScanSettings settings, Executor executor, ScanListener listener, WorkSource workSource) throws Exception { - assertEquals(settings.band, WifiScanner.WIFI_BAND_BOTH_WITH_DFS); + assertEquals(settings.band, WifiScanner.WIFI_BAND_ALL); assertNull(settings.channels); }}).when(mWifiScanner).startScan(anyObject(), anyObject(), anyObject(), anyObject()); @@ -2110,7 +2110,7 @@ public class WifiConnectivityManagerTest extends WifiBaseTest { CANDIDATE_NETWORK_ID, Process.WIFI_UID, CANDIDATE_BSSID); // Set up as full band scan results. - when(mScanData.getBandScanned()).thenReturn(WifiScanner.WIFI_BAND_BOTH_WITH_DFS); + when(mScanData.getBandScanned()).thenReturn(WifiScanner.WIFI_BAND_ALL); // Force a connectivity scan which enables WifiConnectivityManager // to wait for full band scan results. diff --git a/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java index 5ba8dbadb..0660e5eec 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiHealthMonitorTest.java @@ -165,7 +165,7 @@ public class WifiHealthMonitorTest extends WifiBaseTest { .thenReturn(mAlarmManager.getAlarmManager()); mScanData = mockScanData(); - mWifiScanner = mockWifiScanner(WifiScanner.WIFI_BAND_BOTH_WITH_DFS); + mWifiScanner = mockWifiScanner(WifiScanner.WIFI_BAND_ALL); when(mWifiInjector.getWifiScanner()).thenReturn(mWifiScanner); when(mWifiNative.getDriverVersion()).thenReturn(mDriverVersion); when(mWifiNative.getFirmwareVersion()).thenReturn(mFirmwareVersion); @@ -703,7 +703,7 @@ public class WifiHealthMonitorTest extends WifiBaseTest { // Add Above2G only scan data mScanData = mockScanDataAbove2GOnly(); - mWifiScanner = mockWifiScanner(WifiScanner.WIFI_BAND_BOTH_WITH_DFS); + mWifiScanner = mockWifiScanner(WifiScanner.WIFI_BAND_ALL); when(mWifiInjector.getWifiScanner()).thenReturn(mWifiScanner); millisecondsPass(5000); mWifiHealthMonitor.setWifiEnabled(true); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java index ff31eb223..17159b5e7 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiNetworkFactoryTest.java @@ -2934,7 +2934,7 @@ public class WifiNetworkFactoryTest extends WifiBaseTest { private void validateScanSettings(@Nullable String hiddenSsid) { ScanSettings scanSettings = mScanSettingsArgumentCaptor.getValue(); assertNotNull(scanSettings); - assertEquals(WifiScanner.WIFI_BAND_BOTH_WITH_DFS, scanSettings.band); + assertEquals(WifiScanner.WIFI_BAND_ALL, scanSettings.band); assertEquals(WifiScanner.SCAN_TYPE_HIGH_ACCURACY, scanSettings.type); assertEquals(WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN, scanSettings.reportEvents); if (hiddenSsid == null) { diff --git a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java index bccf6b49a..0264bc261 100644 --- a/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java +++ b/tests/wifitests/src/com/android/server/wifi/scanner/WifiScanningServiceTest.java @@ -1694,10 +1694,10 @@ public class WifiScanningServiceTest extends WifiBaseTest { @Test public void retrieveSingleScanResults() throws Exception { WifiScanner.ScanSettings requestSettings = - createRequest(WifiScanner.WIFI_BAND_BOTH_WITH_DFS, - 0, 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); + createRequest(WifiScanner.WIFI_BAND_ALL, 0, 0, 20, + WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); ScanResults expectedResults = - ScanResults.create(0, WifiScanner.WIFI_BAND_BOTH_WITH_DFS, 2412, 5160, 5175); + ScanResults.create(0, WifiScanner.WIFI_BAND_ALL, 2412, 5160, 5175); doSuccessfulSingleScan(requestSettings, computeSingleScanNativeSettings(requestSettings), expectedResults); @@ -1772,10 +1772,10 @@ public class WifiScanningServiceTest extends WifiBaseTest { */ @Test public void retrieveMostRecentFullSingleScanResults() throws Exception { - WifiScanner.ScanSettings requestSettings = createRequest(WifiScanner.WIFI_BAND_BOTH, 0, - 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); - ScanResults expectedResults = ScanResults.create( - 0, WifiScanner.WIFI_BAND_BOTH, 2412, 5160, 5175); + int scanBand = WifiScanner.WIFI_BAND_ALL & ~WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY; + WifiScanner.ScanSettings requestSettings = createRequest(scanBand, 0, 0, 20, + WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); + ScanResults expectedResults = ScanResults.create(0, scanBand, 2412, 5160, 5175); doSuccessfulSingleScan(requestSettings, computeSingleScanNativeSettings(requestSettings), expectedResults); @@ -1795,7 +1795,7 @@ public class WifiScanningServiceTest extends WifiBaseTest { // now update with a new scan that only has one result int secondScanRequestId = 35; - ScanResults expectedSingleResult = ScanResults.create(0, WifiScanner.WIFI_BAND_BOTH, 5160); + ScanResults expectedSingleResult = ScanResults.create(0, scanBand, 5160); sendSingleScanRequest(controlChannel, secondScanRequestId, requestSettings, null); mLooper.dispatchAll(); @@ -1829,10 +1829,11 @@ public class WifiScanningServiceTest extends WifiBaseTest { */ @Test public void doesNotRetrieveMostRecentPartialSingleScanResults() throws Exception { - WifiScanner.ScanSettings fullRequestSettings = createRequest(WifiScanner.WIFI_BAND_BOTH, 0, + int scanBand = WifiScanner.WIFI_BAND_ALL & ~WifiScanner.WIFI_BAND_5_GHZ_DFS_ONLY; + WifiScanner.ScanSettings fullRequestSettings = createRequest(scanBand, 0, 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); ScanResults expectedFullResults = - ScanResults.create(0, WifiScanner.WIFI_BAND_BOTH, 2412, 5160, 5175); + ScanResults.create(0, scanBand, 2412, 5160, 5175); doSuccessfulSingleScan(fullRequestSettings, computeSingleScanNativeSettings(fullRequestSettings), expectedFullResults); @@ -1890,10 +1891,10 @@ public class WifiScanningServiceTest extends WifiBaseTest { */ @Test public void doesNotRetrieveStaleScanResultsFromLastFullSingleScan() throws Exception { - WifiScanner.ScanSettings requestSettings = createRequest(WifiScanner.WIFI_BAND_BOTH, 0, + WifiScanner.ScanSettings requestSettings = createRequest(WifiScanner.WIFI_BAND_ALL, 0, 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); ScanResults scanResults = - ScanResults.create(0, WifiScanner.WIFI_BAND_BOTH, 2412, 5160, 5175); + ScanResults.create(0, WifiScanner.WIFI_BAND_ALL, 2412, 5160, 5175); // Out of the 3 scan results, modify the timestamp of 2 of them to be within the expiration // age and 1 out of it. @@ -1932,10 +1933,10 @@ public class WifiScanningServiceTest extends WifiBaseTest { @Test public void validateScanResultsClearedAfterDriverUnloaded() throws Exception { WifiScanner.ScanSettings requestSettings = - createRequest(WifiScanner.WIFI_BAND_BOTH_WITH_DFS, + createRequest(WifiScanner.WIFI_BAND_ALL, 0, 0, 20, WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN); ScanResults expectedResults = ScanResults.create( - 0, WifiScanner.WIFI_BAND_BOTH_WITH_DFS, 2412, 5160, 5175); + 0, WifiScanner.WIFI_BAND_ALL, 2412, 5160, 5175); doSuccessfulSingleScan(requestSettings, computeSingleScanNativeSettings(requestSettings), expectedResults); |