summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Jiang <qiangjiang@google.com>2019-11-25 13:59:22 -0800
committerandroid-build-merger <android-build-merger@google.com>2019-11-25 13:59:22 -0800
commit0a2ab34d49dddb4df0565c7124f1faf566c6bc1d (patch)
tree49d5ad3c49de408a2698af17f6bbe1b57c2ce852
parente56d9511ac1429a49662bf66714aa9bb0a5b5b0d (diff)
parentc481bdc54f3c2420c67d1f19a1c6e0dbfdada19a (diff)
Update the WifiConfig each time evalutor return a candidate.
am: c481bdc54f Change-Id: I632037554894df148f644bb8bc5231c4234f92b8
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
index ec8a009d9..148af39c6 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
@@ -231,24 +231,20 @@ public class PasspointNetworkEvaluator implements WifiNetworkSelector.NetworkEva
if (existingNetwork != null) {
WifiConfiguration.NetworkSelectionStatus status =
existingNetwork.getNetworkSelectionStatus();
- if (!status.isNetworkEnabled()) {
- boolean isSuccess = mWifiConfigManager.tryEnableNetwork(existingNetwork.networkId);
- if (isSuccess) {
- return existingNetwork;
- }
+ if (!status.isNetworkEnabled()
+ && !mWifiConfigManager.tryEnableNetwork(existingNetwork.networkId)) {
localLog("Current configuration for the Passpoint AP " + config.SSID
+ " is disabled, skip this candidate");
return null;
}
- return existingNetwork;
}
- // Add the newly created WifiConfiguration to WifiConfigManager.
+ // Add or update with the newly created WifiConfiguration to WifiConfigManager.
NetworkUpdateResult result =
mWifiConfigManager.addOrUpdateNetwork(config, Process.WIFI_UID);
if (!result.isSuccess()) {
localLog("Failed to add passpoint network");
- return null;
+ return existingNetwork;
}
mWifiConfigManager.enableNetwork(result.getNetworkId(), false, Process.WIFI_UID);
mWifiConfigManager.setNetworkCandidateScanResult(result.getNetworkId(),