summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2017-06-02 16:29:34 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-06-02 16:29:34 +0000
commit4b75a72b3ef6d8f5dc8b01ebad0e79f74b1d82b4 (patch)
tree23d29d4f1e6f1ff34e9076c8eae341aba2c0d5f4 /tests
parent05a9a73b519a68ee7def7472dad6c6570f2fed86 (diff)
parent1f13f35e55d99b6147b77889347ddc7a53aad3f1 (diff)
Merge "SavedNetworkEvaluator: ignore ephemeral networks" into oc-dev am: a1c5c10247
am: 1f13f35e55 Change-Id: Ie79fe2799f9014360a023c0a652bb505ee155874
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/SavedNetworkEvaluatorTest.java27
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}.
*/