summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2019-10-29 15:43:06 -0700
committerxshu <xshu@google.com>2019-10-30 14:11:47 -0700
commitfb74e5b7868179d772c96f7d4f31158161354b09 (patch)
treec8bf68ddb91844564c5325a87935d54a8d1e635f /service
parent49c4d5dc84ba7d4a747c511204d41bf28c47cfc5 (diff)
NetworkSelector#selectNetwork use Set instead of HashSet
Currently selectNetwork takes as input the BSSID blocklist as a HashSet, but I don't see any reasons why we need this restriction. Changed the input type to Set instead. Bug: 139287182 Test: atest FrameworksWifiTests Change-Id: Ic0ae01ef18e8d0b83e765b2445a0d77a19fefe90
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConnectivityManager.java4
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkSelector.java6
2 files changed, 4 insertions, 6 deletions
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java
index c77275ea0..2ea7addd3 100644
--- a/service/java/com/android/server/wifi/WifiConnectivityManager.java
+++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java
@@ -43,7 +43,6 @@ import com.android.server.wifi.util.ScanResultUtil;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.util.ArrayList;
-import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
@@ -239,8 +238,7 @@ public class WifiConnectivityManager {
*/
private boolean handleScanResults(List<ScanDetail> scanDetails, String listenerName) {
// Check if any blocklisted BSSIDs can be freed.
- HashSet<String> bssidBlocklist =
- new HashSet<>(mBssidBlocklistMonitor.updateAndGetBssidBlocklist());
+ Set<String> bssidBlocklist = mBssidBlocklistMonitor.updateAndGetBssidBlocklist();
if (mStateMachine.isSupplicantTransientState()) {
localLog(listenerName
diff --git a/service/java/com/android/server/wifi/WifiNetworkSelector.java b/service/java/com/android/server/wifi/WifiNetworkSelector.java
index 039550014..49254e949 100644
--- a/service/java/com/android/server/wifi/WifiNetworkSelector.java
+++ b/service/java/com/android/server/wifi/WifiNetworkSelector.java
@@ -44,9 +44,9 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Set;
/**
* This class looks at all the connectivity scan results then
@@ -371,7 +371,7 @@ public class WifiNetworkSelector {
}
private List<ScanDetail> filterScanResults(List<ScanDetail> scanDetails,
- HashSet<String> bssidBlacklist, boolean isConnected, String currentBssid) {
+ Set<String> bssidBlacklist, boolean isConnected, String currentBssid) {
ArrayList<NetworkKey> unscoredNetworks = new ArrayList<NetworkKey>();
List<ScanDetail> validScanDetails = new ArrayList<ScanDetail>();
StringBuffer noValidSsid = new StringBuffer();
@@ -665,7 +665,7 @@ public class WifiNetworkSelector {
*/
@Nullable
public WifiConfiguration selectNetwork(List<ScanDetail> scanDetails,
- HashSet<String> bssidBlacklist, WifiInfo wifiInfo,
+ Set<String> bssidBlacklist, WifiInfo wifiInfo,
boolean connected, boolean disconnected, boolean untrustedNetworkAllowed) {
mFilteredNetworks.clear();
mConnectableNetworks.clear();