diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2020-04-23 09:06:55 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-04-23 09:06:55 +0000 |
commit | f4b94cc1e821dc0a9d5c91e72f61f448337eb01d (patch) | |
tree | 9cd90fb0e4e0c6587a4cac93e869f131982efbc1 /service | |
parent | 6d3b675cbbb3f8311c0cbcbb796a70a369f211dc (diff) | |
parent | 8a23bb63629a8528ca0c1bfda66b84037dcb3a89 (diff) |
Merge "Fill L2 Information in the initial provisioning configuration." into rvc-dev am: 8a23bb6362
Change-Id: Ib516d4adca68ae865978c42fc670cfa0a9f94986
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 48dedc29d..63ebf9824 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -2693,9 +2693,14 @@ public class ClientModeImpl extends StateMachine { if (mIpClient != null) { Pair<String, String> p = mWifiScoreCard.getL2KeyAndGroupHint(mWifiInfo); if (!p.equals(mLastL2KeyAndGroupHint)) { + final MacAddress lastBssid = getCurrentBssid(); final Layer2Information l2Information = new Layer2Information( - p.first, p.second, - mLastBssid != null ? MacAddress.fromString(mLastBssid) : null); + p.first, p.second, lastBssid); + // Update current BSSID on IpClient side whenever l2Key and groupHint + // pair changes (i.e. the initial connection establishment or L2 roaming + // happened). If we have COMPLETED the roaming to a different BSSID, start + // doing DNAv4/DNAv6 -style probing for on-link neighbors of interest (e.g. + // routers/DNS servers/default gateway). if (mIpClient.updateLayer2Information(l2Information)) { mLastL2KeyAndGroupHint = p; } else { @@ -3676,6 +3681,16 @@ public class ClientModeImpl extends StateMachine { return mLastBssid; } + MacAddress getCurrentBssid() { + MacAddress bssid = null; + try { + bssid = (mLastBssid != null) ? MacAddress.fromString(mLastBssid) : null; + } catch (IllegalArgumentException e) { + Log.e(TAG, "Invalid BSSID format: " + mLastBssid); + } + return bssid; + } + void connectToNetwork(WifiConfiguration config) { if ((config != null) && mWifiNative.connectToNetwork(mInterfaceName, config)) { mWifiInjector.getWifiLastResortWatchdog().noteStartConnectTime(); @@ -3893,23 +3908,7 @@ public class ClientModeImpl extends StateMachine { transitionTo(mDisconnectedState); } - // If we have COMPLETED a connection to a BSSID, start doing - // DNAv4/DNAv6 -style probing for on-link neighbors of - // interest (e.g. routers); harmless if none are configured. if (state == SupplicantState.COMPLETED) { - if (mIpClient != null) { - MacAddress lastBssid = null; - try { - lastBssid = (mLastBssid != null) - ? MacAddress.fromString(mLastBssid) : null; - } catch (IllegalArgumentException e) { - Log.e(TAG, "Invalid BSSID format: " + mLastBssid); - } - final Layer2Information info = new Layer2Information( - mLastL2KeyAndGroupHint.first, mLastL2KeyAndGroupHint.second, - lastBssid); - mIpClient.updateLayer2Information(info); - } mWifiScoreReport.noteIpCheck(); } break; @@ -6378,6 +6377,14 @@ public class ClientModeImpl extends StateMachine { + " isFilsConnection=" + isFilsConnection); } + final MacAddress currentBssid = getCurrentBssid(); + final String l2Key = mLastL2KeyAndGroupHint != null + ? mLastL2KeyAndGroupHint.first : null; + final String groupHint = mLastL2KeyAndGroupHint != null + ? mLastL2KeyAndGroupHint.second : null; + final Layer2Information layer2Info = new Layer2Information(l2Key, groupHint, + currentBssid); + if (isFilsConnection) { stopIpClient(); if (isUsingStaticIp) { @@ -6391,6 +6398,7 @@ public class ClientModeImpl extends StateMachine { .withPreconnection() .withApfCapabilities( mWifiNative.getApfCapabilities(mInterfaceName)) + .withLayer2Information(layer2Info) .build(); mIpClient.startProvisioning(prov); } else { @@ -6455,6 +6463,7 @@ public class ClientModeImpl extends StateMachine { .withNetwork(getCurrentNetwork()) .withDisplayName(config.SSID) .withScanResultInfo(scanResultInfo) + .withLayer2Information(layer2Info) .build(); } else { StaticIpConfiguration staticIpConfig = config.getStaticIpConfiguration(); @@ -6463,6 +6472,7 @@ public class ClientModeImpl extends StateMachine { .withApfCapabilities(mWifiNative.getApfCapabilities(mInterfaceName)) .withNetwork(getCurrentNetwork()) .withDisplayName(config.SSID) + .withLayer2Information(layer2Info) .build(); } mIpClient.startProvisioning(prov); |