diff options
author | Randy Pan <zpan@google.com> | 2017-06-02 16:17:22 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-06-02 16:17:22 +0000 |
commit | 1f13f35e55d99b6147b77889347ddc7a53aad3f1 (patch) | |
tree | 230bd01d019563d482e3998a7587cb2420143974 /tests | |
parent | 7e1def214f0031c8c596928d0e9b3738cf4e2648 (diff) | |
parent | a1c5c10247d9e00f740956ce949b3ca0d9401e60 (diff) |
Merge "SavedNetworkEvaluator: ignore ephemeral networks" into oc-dev
am: a1c5c10247
Change-Id: Ibf726c426685dfcc7e65bca5f56669425edec5e2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java b/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java index 78a3a3d0f..7f6360408 100644 --- a/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java @@ -172,6 +172,33 @@ public class SavedNetworkEvaluatorTest { } /** + * Do not evaluate networks that {@link WifiConfiguration#isEphemeral}. + */ + @Test + public void ignoreEphemeralNetworks() { + String[] ssids = {"\"test1\"", "\"test2\""}; + String[] bssids = {"6c:f3:7f:ae:8c:f3", "6c:f3:7f:ae:8c:f4"}; + int[] freqs = {2470, 2437}; + String[] caps = {"[ESS]", "[ESS]"}; + int[] levels = {mThresholdQualifiedRssi2G + 8, mThresholdQualifiedRssi2G + 10}; + int[] securities = {SECURITY_NONE, SECURITY_NONE}; + + ScanDetailsAndWifiConfigs scanDetailsAndConfigs = + WifiNetworkSelectorTestUtil.setupScanDetailsAndConfigStore(ssids, bssids, + freqs, caps, levels, securities, mWifiConfigManager, mClock); + List<ScanDetail> scanDetails = scanDetailsAndConfigs.getScanDetails(); + WifiConfiguration[] savedConfigs = scanDetailsAndConfigs.getWifiConfigs(); + for (WifiConfiguration wifiConfiguration : savedConfigs) { + wifiConfiguration.ephemeral = true; + } + + WifiConfiguration candidate = mSavedNetworkEvaluator.evaluateNetworks(scanDetails, + null, null, true, false, null); + + assertNull(candidate); + } + + /** * Set the candidate {@link ScanResult} for all {@link WifiConfiguration}s regardless of * whether they are secure saved, open saved, or {@link WifiConfiguration#useExternalScores}. */ |