summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-01-31 22:50:37 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-01-31 22:50:38 +0000
commit9f880cb9a5e208c4f5ae5ab5e1d3f2d164740458 (patch)
tree282fda9cb302e547d455c54e4832cf30d6a70f63 /service
parentec8b297e0fbf4ed94c2c8a1a7694f80010359adc (diff)
parent850116348dacd6baf16645641c3383970e4a1157 (diff)
Merge "hotspot2: cache ScanDetail for Passpoint network"
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java16
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java1
2 files changed, 17 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index e4bf1e4f4..17110f319 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -1877,6 +1877,22 @@ public class WifiConfigManager {
}
/**
+ * Save the ScanDetail to the ScanDetailCache of the given network. This is used
+ * by {@link com.android.server.wifi.hotspot2.PasspointNetworkEvaluator} for caching
+ * ScanDetail for newly created {@link WifiConfiguration} for Passpoint network.
+ *
+ * @param networkId The ID of the network to save ScanDetail to
+ * @param scanDetail The ScanDetail to cache
+ */
+ public void updateScanDetailForNetwork(int networkId, ScanDetail scanDetail) {
+ WifiConfiguration network = getInternalConfiguredNetwork(networkId);
+ if (network == null) {
+ return;
+ }
+ saveToScanDetailCacheForNetwork(network, scanDetail);
+ }
+
+ /**
* Helper method to check if the 2 provided networks can be linked or not.
* Networks are considered for linking if:
* 1. Share the same GW MAC address.
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
index 77b29a8da..5eafc1759 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
@@ -126,6 +126,7 @@ public class PasspointNetworkEvaluator implements WifiNetworkSelector.NetworkEva
}
mWifiConfigManager.setNetworkCandidateScanResult(result.getNetworkId(),
scanDetail.getScanResult(), 0);
+ mWifiConfigManager.updateScanDetailForNetwork(result.getNetworkId(), scanDetail);
return mWifiConfigManager.getConfiguredNetwork(result.getNetworkId());
}