summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorPeter Qiu <zqiu@google.com>2017-03-30 11:07:01 -0700
committerPeter Qiu <zqiu@google.com>2017-03-30 14:38:53 -0700
commit6ecd7a8dcde46e3524c15c4a07075ca06ab681b5 (patch)
treeb92746c8d6334c5f878eca7a5783d291b9342019 /service
parent3108e4b84d64353b6a055655af92271c98ad267e (diff)
hotspot2: initiate disconnect when updating current network's provider
When a Passpoint provider configuration that's being used for the current network connection is updated, we should initiate a disconnect from the current connection so that updated provider configuration (e.g. credential) will be used. Bug: 36777009 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: verify WiFi is disconnect then reconnect when updating Passpoint provider that's used for the current connection Change-Id: Id5ed0883a75ef8b0ca6d238f4e8e52d7a4d36ea7
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/WifiStateMachine.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java
index ebe6c3d07..6e5da1716 100644
--- a/service/java/com/android/server/wifi/WifiStateMachine.java
+++ b/service/java/com/android/server/wifi/WifiStateMachine.java
@@ -5172,6 +5172,20 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss
// TODO(b/31065385): Passpoint config management.
replyToMessage(message, message.what, 0);
break;
+ case CMD_ADD_OR_UPDATE_PASSPOINT_CONFIG:
+ PasspointConfiguration passpointConfig = (PasspointConfiguration) message.obj;
+ if (mPasspointManager.addOrUpdateProvider(passpointConfig)) {
+ String fqdn = passpointConfig.getHomeSp().getFqdn();
+ if (isProviderOwnedNetwork(mTargetNetworkId, fqdn)
+ || isProviderOwnedNetwork(mLastNetworkId, fqdn)) {
+ logd("Disconnect from current network since its provider is updated");
+ sendMessage(CMD_DISCONNECT);
+ }
+ replyToMessage(message, message.what, SUCCESS);
+ } else {
+ replyToMessage(message, message.what, FAILURE);
+ }
+ break;
case CMD_REMOVE_PASSPOINT_CONFIG:
String fqdn = (String) message.obj;
if (mPasspointManager.removeProvider(fqdn)) {