diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-03-15 01:45:50 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-15 01:45:51 +0000 |
commit | 7c4e3b39a5fba0749cab3c244dcda45a1ff3c35b (patch) | |
tree | 48a373677a1b3613fa31c8257aefc3246795fc27 /service | |
parent | a4d316f8e789bc1aa6645235f139e48636fe1f2d (diff) | |
parent | 67a4541372684c5d0a3f834f8be76bd8d29ca7ac (diff) |
Merge "hotspot2: ignore Passpoint networks in SavedNetworkEvaluator"
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/SavedNetworkEvaluator.java | 28 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java | 1 |
2 files changed, 20 insertions, 9 deletions
diff --git a/service/java/com/android/server/wifi/SavedNetworkEvaluator.java b/service/java/com/android/server/wifi/SavedNetworkEvaluator.java index 25591f59e..98cecf170 100644 --- a/service/java/com/android/server/wifi/SavedNetworkEvaluator.java +++ b/service/java/com/android/server/wifi/SavedNetworkEvaluator.java @@ -47,7 +47,6 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat private final int mSameNetworkAward; private final int mBand5GHzAward; private final int mLastSelectionAward; - private final int mPasspointSecurityAward; private final int mSecurityAward; private final int mNoInternetPenalty; private final int mThresholdSaturatedRssi24; @@ -70,8 +69,6 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat R.integer.config_wifi_framework_current_network_boost); mLastSelectionAward = context.getResources().getInteger( R.integer.config_wifi_framework_LAST_SELECTION_AWARD); - mPasspointSecurityAward = context.getResources().getInteger( - R.integer.config_wifi_framework_PASSPOINT_SECURITY_AWARD); mSecurityAward = context.getResources().getInteger( R.integer.config_wifi_framework_SECURITY_AWARD); mBand5GHzAward = context.getResources().getInteger( @@ -125,6 +122,15 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat StringBuffer sbuf = new StringBuffer("Saved Networks List: \n"); for (WifiConfiguration network : savedNetworks) { + /** + * Ignore Passpoint networks. Passpoint networks are also considered as "saved" + * network, but without being persisted to the storage. They are managed + * by {@link PasspointNetworkEvaluator}. + */ + if (network.isPasspoint()) { + continue; + } + WifiConfiguration.NetworkSelectionStatus status = network.getNetworkSelectionStatus(); @@ -211,10 +217,7 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat } // Security award. - if (network.isPasspoint()) { - score += mPasspointSecurityAward; - sbuf.append(" Passpoint bonus: ").append(mPasspointSecurityAward).append(","); - } else if (!WifiConfigurationUtil.isConfigForOpenNetwork(network)) { + if (!WifiConfigurationUtil.isConfigForOpenNetwork(network)) { score += mSecurityAward; sbuf.append(" Secure network bonus: ").append(mSecurityAward).append(","); } @@ -253,8 +256,6 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat // One ScanResult can be associated with more than one networks, hence we calculate all // the scores and use the highest one as the ScanResult's score. - // TODO(b/31065385): WifiConfigManager does not support passpoint networks currently. - // So this list has just one entry always. List<WifiConfiguration> associatedConfigurations = null; WifiConfiguration associatedConfiguration = mWifiConfigManager.getSavedNetworkForScanDetailAndCache(scanDetail); @@ -267,6 +268,15 @@ public class SavedNetworkEvaluator implements WifiNetworkSelector.NetworkEvaluat } for (WifiConfiguration network : associatedConfigurations) { + /** + * Ignore Passpoint networks. Passpoint networks are also considered as "saved" + * network, but without being persisted to the storage. They are being evaluated + * by {@link PasspointNetworkEvaluator}. + */ + if (network.isPasspoint()) { + continue; + } + WifiConfiguration.NetworkSelectionStatus status = network.getNetworkSelectionStatus(); status.setSeenInLastQualifiedNetworkSelection(true); diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java index 5eafc1759..f08b5de32 100644 --- a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java +++ b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java @@ -124,6 +124,7 @@ public class PasspointNetworkEvaluator implements WifiNetworkSelector.NetworkEva localLog("Failed to add passpoint network"); return null; } + mWifiConfigManager.enableNetwork(result.getNetworkId(), false, Process.WIFI_UID); mWifiConfigManager.setNetworkCandidateScanResult(result.getNetworkId(), scanDetail.getScanResult(), 0); mWifiConfigManager.updateScanDetailForNetwork(result.getNetworkId(), scanDetail); |