summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-04-23 08:53:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-04-23 08:53:36 +0000
commit8a23bb63629a8528ca0c1bfda66b84037dcb3a89 (patch)
tree7e8565aa3c435776570b54d088a1ec14ec0af248
parenta8098810059b46dde92c68632b72c4f195eb0ac3 (diff)
parentdfe6cd89f4f49d6475ea1669447efed2c84a04d6 (diff)
Merge "Fill L2 Information in the initial provisioning configuration." into rvc-dev
-rw-r--r--service/java/com/android/server/wifi/ClientModeImpl.java46
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);