diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-10-17 00:22:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-10-17 00:22:47 +0000 |
commit | 44ab9ffa3fc11e1ee5edb16896f1da61515a58f2 (patch) | |
tree | 14da50025970709d956d2a2258b2050ce9956000 /service | |
parent | 9d3d30cd26c52553921714eac9b1610c4297f731 (diff) | |
parent | e3f2a3807be2e36ab8804990d5f77ef43fbf23d1 (diff) |
Merge "[ClientModeImpl] Connect when credentials change"
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index e2b9458de..04d3dc0ac 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -3853,14 +3853,14 @@ public class ClientModeImpl extends StateMachine { break; case CMD_SAVE_NETWORK: result = saveNetworkConfigAndInvokeCb(message); + if (!result.isSuccess()) break; netId = result.getNetworkId(); - if (result.isSuccess() && mWifiInfo.getNetworkId() == netId) { + if (mWifiInfo.getNetworkId() == netId) { if (result.hasCredentialChanged()) { - config = (WifiConfiguration) message.obj; // The network credentials changed and we're connected to this network, // start a new connection with the updated credentials. - logi("CMD_SAVE_NETWORK credential changed for config=" - + config.configKey() + ", Reconnecting."); + logi("CMD_SAVE_NETWORK credential changed for nid=" + + netId + ". Reconnecting."); startConnectToNetwork(netId, message.sendingUid, SUPPLICANT_BSSID_ANY); } else { if (result.hasProxyChanged()) { @@ -3878,6 +3878,11 @@ public class ClientModeImpl extends StateMachine { transitionTo(mObtainingIpState); } } + } else if (mWifiInfo.getNetworkId() == WifiConfiguration.INVALID_NETWORK_ID + && result.hasCredentialChanged()) { + logi("CMD_SAVE_NETWORK credential changed for nid=" + + netId + " while disconnected. Connecting."); + startConnectToNetwork(netId, message.sendingUid, SUPPLICANT_BSSID_ANY); } break; case CMD_FORGET_NETWORK: |