diff options
author | Xiao Ma <xiaom@google.com> | 2020-04-16 16:20:25 +0900 |
---|---|---|
committer | Xiao Ma <xiaom@google.com> | 2020-04-20 22:52:11 +0900 |
commit | 43cbcaea68608c3a3af129ad4ec972de8aafd5c4 (patch) | |
tree | c3bfbe683973dcd1ff0df81404aad934850d30a9 /src/android/net/ip/IpClient.java | |
parent | 039d7960521483346382ca244d501fa136935d9e (diff) |
Get the l2key and grouphint from the initial provisioning configuration.
The purpose of processing CMD_UPDATE_L2INFO command in the Stopped
State is just to update the initial l2key and grouphint which are
used when starting DhcpClient (e.g. for INIT-REBOOT). We can get
both of l2key and groupHint from the initial prov configuration
parcelable instead, then be able to delete CMD_UPDATE_L2INFO from
the StoppedState.
Bug: 154441742
Test: atest FrameworksNetTests NetworkStackTests
Test: atest NetworkStackIntegrationTests
Change-Id: I760957017b18975be969a2f519ec09ee4495ebad
Diffstat (limited to 'src/android/net/ip/IpClient.java')
-rw-r--r-- | src/android/net/ip/IpClient.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/android/net/ip/IpClient.java b/src/android/net/ip/IpClient.java index 3fb5001..79ceee7 100644 --- a/src/android/net/ip/IpClient.java +++ b/src/android/net/ip/IpClient.java @@ -794,6 +794,11 @@ public class IpClient extends StateMachine { + " in provisioning configuration", e); } } + + if (req.mLayer2Info != null) { + mL2Key = req.mLayer2Info.mL2Key; + mGroupHint = req.mLayer2Info.mGroupHint; + } sendMessage(CMD_START, new android.net.shared.ProvisioningConfiguration(req)); } @@ -904,7 +909,7 @@ public class IpClient extends StateMachine { } /** - * Update the network bssid, L2Key and GroupHint layer2 information. + * Update the network bssid, L2Key and GroupHint on L2 roaming happened. */ public void updateLayer2Information(@NonNull Layer2InformationParcelable info) { sendMessage(CMD_UPDATE_L2INFORMATION, info); @@ -1534,10 +1539,10 @@ public class IpClient extends StateMachine { mL2Key = info.l2Key; mGroupHint = info.groupHint; - // This means IpClient is still in the StoppedState, WiFi is trying to associate - // to the AP, just update L2Key and GroupHint at this stage, because these members - // will be used when starting DhcpClient. - if (info.bssid == null || mCurrentBssid == null) return; + if (info.bssid == null || mCurrentBssid == null) { + Log.wtf(mTag, "bssid in the parcelable or current tracked bssid should be non-null"); + return; + } // If the BSSID has not changed, there is nothing to do. if (info.bssid.equals(mCurrentBssid)) return; @@ -1613,10 +1618,6 @@ public class IpClient extends StateMachine { break; } - case CMD_UPDATE_L2INFORMATION: - handleUpdateL2Information((Layer2InformationParcelable) msg.obj); - break; - case CMD_SET_MULTICAST_FILTER: mMulticastFiltering = (boolean) msg.obj; break; |