Loading common/moduleutils/src/android/net/shared/Layer2Information.java +4 −4 Original line number Diff line number Diff line Loading @@ -23,9 +23,9 @@ import java.util.Objects; /** @hide */ public class Layer2Information { private final String mL2Key; private final String mGroupHint; private final MacAddress mBssid; public final String mL2Key; public final String mGroupHint; public final MacAddress mBssid; /** * Create a Layer2Information with the specified configuration. Loading Loading @@ -60,7 +60,7 @@ public class Layer2Information { * Create an instance of {@link Layer2Information} based on the contents of the specified * {@link Layer2InformationParcelable}. */ public Layer2Information fromStableParcelable(Layer2InformationParcelable p) { public static Layer2Information fromStableParcelable(Layer2InformationParcelable p) { if (p == null) return null; return new Layer2Information(p.l2Key, p.groupHint, p.bssid); } Loading common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java +15 −1 Original line number Diff line number Diff line Loading @@ -218,6 +218,14 @@ public class ProvisioningConfiguration { return this; } /** * Specify the L2 information(bssid, l2key and groupHint) that the IpClient should use. */ public Builder withLayer2Information(Layer2Information layer2Info) { mConfig.mLayer2Info = layer2Info; return this; } /** * Build the configuration using previously specified parameters. */ Loading Loading @@ -421,6 +429,7 @@ public class ProvisioningConfiguration { public Network mNetwork = null; public String mDisplayName = null; public ScanResultInfo mScanResultInfo; public Layer2Information mLayer2Info; public ProvisioningConfiguration() {} // used by Builder Loading @@ -441,6 +450,7 @@ public class ProvisioningConfiguration { mNetwork = other.mNetwork; mDisplayName = other.mDisplayName; mScanResultInfo = other.mScanResultInfo; mLayer2Info = other.mLayer2Info; } /** Loading @@ -464,6 +474,7 @@ public class ProvisioningConfiguration { p.network = mNetwork; p.displayName = mDisplayName; p.scanResultInfo = mScanResultInfo == null ? null : mScanResultInfo.toStableParcelable(); p.layer2Info = mLayer2Info == null ? null : mLayer2Info.toStableParcelable(); return p; } Loading @@ -490,6 +501,7 @@ public class ProvisioningConfiguration { config.mNetwork = p.network; config.mDisplayName = p.displayName; config.mScanResultInfo = ScanResultInfo.fromStableParcelable(p.scanResultInfo); config.mLayer2Info = Layer2Information.fromStableParcelable(p.layer2Info); return config; } Loading @@ -510,6 +522,7 @@ public class ProvisioningConfiguration { .add("mNetwork: " + mNetwork) .add("mDisplayName: " + mDisplayName) .add("mScanResultInfo: " + mScanResultInfo) .add("mLayer2Info: " + mLayer2Info) .toString(); } Loading @@ -530,7 +543,8 @@ public class ProvisioningConfiguration { && mIPv6AddrGenMode == other.mIPv6AddrGenMode && Objects.equals(mNetwork, other.mNetwork) && Objects.equals(mDisplayName, other.mDisplayName) && Objects.equals(mScanResultInfo, other.mScanResultInfo); && Objects.equals(mScanResultInfo, other.mScanResultInfo) && Objects.equals(mLayer2Info, other.mLayer2Info); } public boolean isValid() { Loading common/networkstackclient/aidl_api/networkstack-aidl-interfaces/current/android/net/ProvisioningConfigurationParcelable.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,5 @@ parcelable ProvisioningConfigurationParcelable { String displayName; boolean enablePreconnection; android.net.ScanResultInfoParcelable scanResultInfo; android.net.Layer2InformationParcelable layer2Info; } common/networkstackclient/src/android/net/ProvisioningConfigurationParcelable.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.net; import android.net.InitialConfigurationParcelable; import android.net.Layer2InformationParcelable; import android.net.Network; import android.net.ScanResultInfoParcelable; import android.net.StaticIpConfiguration; Loading @@ -38,4 +39,5 @@ parcelable ProvisioningConfigurationParcelable { String displayName; boolean enablePreconnection; ScanResultInfoParcelable scanResultInfo; Layer2InformationParcelable layer2Info; } src/android/net/ip/IpClient.java +10 −9 Original line number Diff line number Diff line Loading @@ -793,6 +793,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)); } Loading Loading @@ -903,7 +908,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); Loading Loading @@ -1532,10 +1537,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; Loading Loading @@ -1610,10 +1615,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; Loading Loading
common/moduleutils/src/android/net/shared/Layer2Information.java +4 −4 Original line number Diff line number Diff line Loading @@ -23,9 +23,9 @@ import java.util.Objects; /** @hide */ public class Layer2Information { private final String mL2Key; private final String mGroupHint; private final MacAddress mBssid; public final String mL2Key; public final String mGroupHint; public final MacAddress mBssid; /** * Create a Layer2Information with the specified configuration. Loading Loading @@ -60,7 +60,7 @@ public class Layer2Information { * Create an instance of {@link Layer2Information} based on the contents of the specified * {@link Layer2InformationParcelable}. */ public Layer2Information fromStableParcelable(Layer2InformationParcelable p) { public static Layer2Information fromStableParcelable(Layer2InformationParcelable p) { if (p == null) return null; return new Layer2Information(p.l2Key, p.groupHint, p.bssid); } Loading
common/moduleutils/src/android/net/shared/ProvisioningConfiguration.java +15 −1 Original line number Diff line number Diff line Loading @@ -218,6 +218,14 @@ public class ProvisioningConfiguration { return this; } /** * Specify the L2 information(bssid, l2key and groupHint) that the IpClient should use. */ public Builder withLayer2Information(Layer2Information layer2Info) { mConfig.mLayer2Info = layer2Info; return this; } /** * Build the configuration using previously specified parameters. */ Loading Loading @@ -421,6 +429,7 @@ public class ProvisioningConfiguration { public Network mNetwork = null; public String mDisplayName = null; public ScanResultInfo mScanResultInfo; public Layer2Information mLayer2Info; public ProvisioningConfiguration() {} // used by Builder Loading @@ -441,6 +450,7 @@ public class ProvisioningConfiguration { mNetwork = other.mNetwork; mDisplayName = other.mDisplayName; mScanResultInfo = other.mScanResultInfo; mLayer2Info = other.mLayer2Info; } /** Loading @@ -464,6 +474,7 @@ public class ProvisioningConfiguration { p.network = mNetwork; p.displayName = mDisplayName; p.scanResultInfo = mScanResultInfo == null ? null : mScanResultInfo.toStableParcelable(); p.layer2Info = mLayer2Info == null ? null : mLayer2Info.toStableParcelable(); return p; } Loading @@ -490,6 +501,7 @@ public class ProvisioningConfiguration { config.mNetwork = p.network; config.mDisplayName = p.displayName; config.mScanResultInfo = ScanResultInfo.fromStableParcelable(p.scanResultInfo); config.mLayer2Info = Layer2Information.fromStableParcelable(p.layer2Info); return config; } Loading @@ -510,6 +522,7 @@ public class ProvisioningConfiguration { .add("mNetwork: " + mNetwork) .add("mDisplayName: " + mDisplayName) .add("mScanResultInfo: " + mScanResultInfo) .add("mLayer2Info: " + mLayer2Info) .toString(); } Loading @@ -530,7 +543,8 @@ public class ProvisioningConfiguration { && mIPv6AddrGenMode == other.mIPv6AddrGenMode && Objects.equals(mNetwork, other.mNetwork) && Objects.equals(mDisplayName, other.mDisplayName) && Objects.equals(mScanResultInfo, other.mScanResultInfo); && Objects.equals(mScanResultInfo, other.mScanResultInfo) && Objects.equals(mLayer2Info, other.mLayer2Info); } public boolean isValid() { Loading
common/networkstackclient/aidl_api/networkstack-aidl-interfaces/current/android/net/ProvisioningConfigurationParcelable.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -31,4 +31,5 @@ parcelable ProvisioningConfigurationParcelable { String displayName; boolean enablePreconnection; android.net.ScanResultInfoParcelable scanResultInfo; android.net.Layer2InformationParcelable layer2Info; }
common/networkstackclient/src/android/net/ProvisioningConfigurationParcelable.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,7 @@ package android.net; import android.net.InitialConfigurationParcelable; import android.net.Layer2InformationParcelable; import android.net.Network; import android.net.ScanResultInfoParcelable; import android.net.StaticIpConfiguration; Loading @@ -38,4 +39,5 @@ parcelable ProvisioningConfigurationParcelable { String displayName; boolean enablePreconnection; ScanResultInfoParcelable scanResultInfo; Layer2InformationParcelable layer2Info; }
src/android/net/ip/IpClient.java +10 −9 Original line number Diff line number Diff line Loading @@ -793,6 +793,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)); } Loading Loading @@ -903,7 +908,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); Loading Loading @@ -1532,10 +1537,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; Loading Loading @@ -1610,10 +1615,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; Loading