summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorEcco Park <eccopark@google.com>2019-04-17 10:53:24 -0700
committerEcco Park <eccopark@google.com>2019-04-17 15:33:04 -0700
commitf61e141c8f344e9e92dfdc4203b7dee0762a8a09 (patch)
treec00581c9ebb58d07d27d2d25e3f27a891cda69a8 /service
parent43c1e848f2b848a02738f3ccce7440c331e9262b (diff)
PasspointNetworkEvaluator: Ignore networks disconnected by user.
WifiConfigManager maintains a blacklist of all ephemeral networks that the user decided to disconnect. Avoid connecting back to them in all the evaluators (already handled in suggestion & scored evaluators). Bug: 130309348 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If72207b166b76bd32ad1bcfcd70fb069464d650f Signed-off-by: Ecco Park <eccopark@google.com>
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java13
-rw-r--r--service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java12
2 files changed, 20 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 9332c5979..48e7e713a 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -2737,7 +2737,7 @@ public class WifiConfigManager {
}
/**
- * Disable an ephemeral SSID for the purpose of network selection.
+ * Disable an ephemeral or Passpoint SSID for the purpose of network selection.
*
* The network will be re-enabled when:
* a) The user creates a network for that SSID and then forgets.
@@ -2754,7 +2754,7 @@ public class WifiConfigManager {
}
WifiConfiguration foundConfig = null;
for (WifiConfiguration config : getInternalConfiguredNetworks()) {
- if (config.ephemeral && TextUtils.equals(config.SSID, ssid)) {
+ if ((config.ephemeral || config.isPasspoint()) && TextUtils.equals(config.SSID, ssid)) {
foundConfig = config;
break;
}
@@ -2764,8 +2764,13 @@ public class WifiConfigManager {
Log.d(TAG, "Forget ephemeral SSID " + ssid + " num="
+ mDeletedEphemeralSsidsToTimeMap.size());
if (foundConfig != null) {
- Log.d(TAG, "Found ephemeral config in disableEphemeralNetwork: "
- + foundConfig.networkId);
+ if (foundConfig.ephemeral) {
+ Log.d(TAG, "Found ephemeral config in disableEphemeralNetwork: "
+ + foundConfig.networkId);
+ } else if (foundConfig.isPasspoint()) {
+ Log.d(TAG, "Found Passpoint config in disableEphemeralNetwork: "
+ + foundConfig.networkId + ", FQDN: " + foundConfig.FQDN);
+ }
}
return foundConfig;
}
diff --git a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
index 9f76a2782..30352814a 100644
--- a/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
+++ b/service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java
@@ -19,6 +19,7 @@ package com.android.server.wifi.hotspot2;
import static com.android.server.wifi.hotspot2.Utils.isCarrierEapMethod;
import android.annotation.NonNull;
+import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.hotspot2.PasspointConfiguration;
import android.os.Process;
@@ -131,10 +132,19 @@ public class PasspointNetworkEvaluator implements WifiNetworkSelector.NetworkEva
if (!scanDetail.getNetworkDetail().isInterworking()) {
continue;
}
+ ScanResult scanResult = scanDetail.getScanResult();
+
+ // If the user previously disconnects this network, don't select it.
+ if (mWifiConfigManager.wasEphemeralNetworkDeleted(
+ ScanResultUtil.createQuotedSSID(scanResult.SSID))) {
+ mLocalLog.log("Ignoring disabled the SSID of Passpoint AP: "
+ + WifiNetworkSelector.toScanId(scanResult));
+ continue;
+ }
// Find the best provider for this ScanDetail.
Pair<PasspointProvider, PasspointMatch> bestProvider =
- mPasspointManager.matchProvider(scanDetail.getScanResult());
+ mPasspointManager.matchProvider(scanResult);
if (bestProvider != null) {
if (bestProvider.first.isSimCredential() && !mWifiConfigManager.isSimPresent()) {
// Skip providers backed by SIM credential when SIM is not present.