summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2016-04-13 09:10:51 -0700
committerRoshan Pius <rpius@google.com>2016-04-13 09:15:33 -0700
commit329b3a9a9bc32d14649e91c15876ea7f95f148d1 (patch)
tree7cdffff3dd39bf78072e2beae69c950fac484486
parent604285d676078e9d0d5c7944770bdba36144363e (diff)
WifiConfigManager: Remove dead code
BUG: 28164778 Change-Id: I1e09b8039dbf7d220fd699b5be3b29330d02a305
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java63
-rw-r--r--service/java/com/android/server/wifi/WifiConfigStore.java40
-rw-r--r--service/java/com/android/server/wifi/WifiConnectivityManager.java2
3 files changed, 13 insertions, 92 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 3aa3b9319..d3de50dc7 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -682,22 +682,6 @@ public class WifiConfigManager {
}
}
- /**
- * Enable a network in wpa_supplicant.
- */
- boolean enableNetworkNative(WifiConfiguration config) {
- return mWifiConfigStore.enableNetwork(config);
- }
-
- /**
- * Enable all networks in wpa_supplicant.
- */
- void enableAllNetworksNative() {
- if (mWifiConfigStore.enableAllNetworks(mConfiguredNetworks.valuesForCurrentUser())) {
- sendConfiguredNetworksChangedBroadcast();
- }
- }
-
private boolean setNetworkPriorityNative(WifiConfiguration config, int priority) {
return mWifiConfigStore.setNetworkPriority(config, priority);
}
@@ -1096,27 +1080,15 @@ public class WifiConfigManager {
* Retrieves an updated list of priorities for all the saved networks before
* enabling disconnected PNO (wpa_supplicant based PNO).
*
- * @return list of networks with updated priorities.
- */
- public ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrieveDisconnectedPnoNetworkList() {
- return retrievePnoNetworkList(true, sDisconnectedPnoListComparator);
- }
-
- /**
- * Retrieves an updated list of priorities for all the saved networks before
- * enabling/disabling disconnected PNO (wpa_supplicant based PNO).
- *
* wpa_supplicant uses the priority of networks to build the list of SSID's to monitor
* during PNO. If there are a lot of saved networks, this list will be truncated and we
* might end up not connecting to the networks we use most frequently. So, We want the networks
* to be re-sorted based on the relative |numAssociation| values.
*
- * @param enablePno boolean indicating whether PNO is being enabled or disabled.
* @return list of networks with updated priorities.
*/
- public ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrieveDisconnectedPnoNetworkList(
- boolean enablePno) {
- return retrievePnoNetworkList(enablePno, sDisconnectedPnoListComparator);
+ public ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrieveDisconnectedPnoNetworkList() {
+ return retrievePnoNetworkList(sDisconnectedPnoListComparator);
}
/**
@@ -1148,7 +1120,7 @@ public class WifiConfigManager {
* @return list of networks with updated priorities.
*/
public ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrieveConnectedPnoNetworkList() {
- return retrievePnoNetworkList(true, sConnectedPnoListComparator);
+ return retrievePnoNetworkList(sConnectedPnoListComparator);
}
/**
@@ -1182,32 +1154,21 @@ public class WifiConfigManager {
* Retrieves an updated list of priorities for all the saved networks before
* enabling/disabling PNO.
*
- * @param enablePno boolean indicating whether PNO is being enabled or disabled.
+ * @param pnoListComparator The comparator to use for sorting networks
* @return list of networks with updated priorities.
*/
private ArrayList<WifiScanner.PnoSettings.PnoNetwork> retrievePnoNetworkList(
- boolean enablePno, PnoListComparator pnoListComparator) {
+ PnoListComparator pnoListComparator) {
ArrayList<WifiScanner.PnoSettings.PnoNetwork> pnoList = new ArrayList<>();
ArrayList<WifiConfiguration> wifiConfigurations =
new ArrayList<>(mConfiguredNetworks.valuesForCurrentUser());
- if (enablePno) {
- Collections.sort(wifiConfigurations, pnoListComparator);
- // Let's use the network list size as the highest priority and then go down from there.
- // So, the most frequently connected network has the highest priority now.
- int priority = wifiConfigurations.size();
- if (DBG) {
- Log.d(TAG, "Retrieve network priorities before PNO. Max priority: " + priority);
- }
- for (WifiConfiguration config : wifiConfigurations) {
- pnoList.add(createPnoNetworkFromWifiConfiguration(config, priority));
- priority--;
- }
- } else {
- // Revert the priorities back to the saved config values after PNO.
- if (DBG) Log.d(TAG, "Retrieve network priorities after PNO.");
- for (WifiConfiguration config : wifiConfigurations) {
- pnoList.add(createPnoNetworkFromWifiConfiguration(config, config.priority));
- }
+ Collections.sort(wifiConfigurations, pnoListComparator);
+ // Let's use the network list size as the highest priority and then go down from there.
+ // So, the most frequently connected network has the highest priority now.
+ int priority = wifiConfigurations.size();
+ for (WifiConfiguration config : wifiConfigurations) {
+ pnoList.add(createPnoNetworkFromWifiConfiguration(config, priority));
+ priority--;
}
return pnoList;
}
diff --git a/service/java/com/android/server/wifi/WifiConfigStore.java b/service/java/com/android/server/wifi/WifiConfigStore.java
index 8b4535ebf..e8b91e3fa 100644
--- a/service/java/com/android/server/wifi/WifiConfigStore.java
+++ b/service/java/com/android/server/wifi/WifiConfigStore.java
@@ -934,25 +934,6 @@ public class WifiConfigStore {
}
/**
- * Enable a network in wpa_supplicant.
- *
- * @param config Config corresponding to the network.
- * @return true if successful, false otherwise.
- */
- public boolean enableNetwork(WifiConfiguration config) {
- if (config == null) {
- return false;
- }
- if (VDBG) localLog("enableNetwork: " + config.networkId);
- if (!mWifiNative.enableNetworkWithoutConnect(config.networkId)) {
- loge("Enable network in wpa_supplicant failed on " + config.networkId);
- return false;
- }
- config.status = Status.ENABLED;
- return true;
- }
-
- /**
* Select a network in wpa_supplicant.
*
* @param config Config corresponding to the network.
@@ -1065,27 +1046,6 @@ public class WifiConfigStore {
}
/**
- * Enables all the networks in the provided list in wpa_supplicant.
- *
- * @param configs Collection of configs which needs to be enabled.
- * @return true if successful, false otherwise.
- */
- public boolean enableAllNetworks(Collection<WifiConfiguration> configs) {
- if (VDBG) localLog("enableAllNetworksNative");
- boolean networkEnabled = false;
- for (WifiConfiguration config : configs) {
- if (config != null && !config.ephemeral
- && !config.getNetworkSelectionStatus().isNetworkEnabled()) {
- if (enableNetwork(config)) {
- networkEnabled = true;
- }
- }
- }
- saveConfig();
- return networkEnabled;
- }
-
- /**
* Disables all the networks in the provided list in wpa_supplicant.
*
* @param configs Collection of configs which needs to be enabled.
diff --git a/service/java/com/android/server/wifi/WifiConnectivityManager.java b/service/java/com/android/server/wifi/WifiConnectivityManager.java
index 5ea33c46d..1ed257241 100644
--- a/service/java/com/android/server/wifi/WifiConnectivityManager.java
+++ b/service/java/com/android/server/wifi/WifiConnectivityManager.java
@@ -534,7 +534,7 @@ public class WifiConnectivityManager {
// Initialize PNO settings
PnoSettings pnoSettings = new PnoSettings();
ArrayList<PnoSettings.PnoNetwork> pnoNetworkList =
- mConfigManager.retrieveDisconnectedPnoNetworkList(true);
+ mConfigManager.retrieveDisconnectedPnoNetworkList();
int listSize = pnoNetworkList.size();
if (listSize == 0) {