diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-04-18 02:04:52 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-18 02:04:52 +0000 |
commit | f6453fd9c06a575d40c61c281bc92c2e4737e314 (patch) | |
tree | e3a7a308ad6c4ffc2147c2ed01ad7bf928044733 /service | |
parent | 8f6aa32ec081631b76a6a75c898a9442bc7061bd (diff) | |
parent | f61e141c8f344e9e92dfdc4203b7dee0762a8a09 (diff) |
Merge "PasspointNetworkEvaluator: Ignore networks disconnected by user." into qt-dev
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/WifiConfigManager.java | 13 | ||||
-rw-r--r-- | service/java/com/android/server/wifi/hotspot2/PasspointNetworkEvaluator.java | 12 |
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 58c51486d..b39743530 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. |