diff options
author | Roshan Pius <rpius@google.com> | 2020-05-29 15:47:43 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-05-30 04:44:19 +0000 |
commit | a442338fbb51bc797ab03eca48d3b0bc0c454e2e (patch) | |
tree | a2a19efa9f3e0d7fe7732d6a540dff5c4ff6ba29 /service | |
parent | 7cf18381fa2099230c49269a435090115b7e633b (diff) |
ClientModeImpl: Ignore connect when connecting to network
Use internal variables to check whether we're connected or connecting to
the network requested in WifiManager.connect(). If there is a credential
change, we will forcefully retrigger a new connection request.
Bug: 157696785
Test: atest com.android.server.wifi
Change-Id: I514b5b3a1ed5205fde98bc6fd2b59285e10913ef
Merged-In: I514b5b3a1ed5205fde98bc6fd2b59285e10913ef
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 0f84b3dd9..7769455e8 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -368,7 +368,7 @@ public class ClientModeImpl extends StateMachine { private String mTargetBssid = SUPPLICANT_BSSID_ANY; // This one is used to track the current target network ID. This is used for error // handling during connection setup since many error message from supplicant does not report - // SSID Once connected, it will be set to invalid + // SSID. Once connected, it will be set to invalid private int mTargetNetworkId = WifiConfiguration.INVALID_NETWORK_ID; private long mLastDriverRoamAttempt = 0; private WifiConfiguration mTargetWifiConfiguration = null; @@ -1211,8 +1211,8 @@ public class ClientModeImpl extends StateMachine { private void connectToUserSelectNetwork(int netId, int uid, boolean forceReconnect) { logd("connectToUserSelectNetwork netId " + netId + ", uid " + uid + ", forceReconnect = " + forceReconnect); - if (!forceReconnect && mWifiInfo.getNetworkId() == netId) { - // We're already connected to the user specified network, don't trigger a + if (!forceReconnect && (mLastNetworkId == netId || mTargetNetworkId == netId)) { + // We're already connecting/connected to the user specified network, don't trigger a // reconnection unless it was forced. logi("connectToUserSelectNetwork already connecting/connected=" + netId); } else { |