diff options
author | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-19 00:52:41 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-02-19 00:52:41 +0000 |
commit | caf78b3ef1fa95c4d4c25366a5479cc29b1c48bf (patch) | |
tree | 003f45d9be8f33c11f1dfc7846c40c3016ce07e8 | |
parent | 7621b17344fc4f297bc03c2024a6cab684b38db4 (diff) | |
parent | b168682aad1dde30c4dda8ef2c18f9fdd4839d3b (diff) |
Merge "Add ScanResultInfo in the ProvisioningConfiguration parcelable." am: b1e84bebbc am: b168682aad
Change-Id: I6c246073ef076aee224a016eeb54d84a029edc0b
-rw-r--r-- | service/java/com/android/server/wifi/ClientModeImpl.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/service/java/com/android/server/wifi/ClientModeImpl.java b/service/java/com/android/server/wifi/ClientModeImpl.java index 218620b3d..64faf9233 100644 --- a/service/java/com/android/server/wifi/ClientModeImpl.java +++ b/service/java/com/android/server/wifi/ClientModeImpl.java @@ -57,6 +57,7 @@ import android.net.ip.IIpClient; import android.net.ip.IpClientCallbacks; import android.net.ip.IpClientManager; import android.net.shared.ProvisioningConfiguration; +import android.net.shared.ProvisioningConfiguration.ScanResultInfo; import android.net.wifi.INetworkRequestMatchCallback; import android.net.wifi.RssiPacketCountInfo; import android.net.wifi.ScanResult; @@ -5387,12 +5388,34 @@ public class ClientModeImpl extends StateMachine { mIpClient.setTcpBufferSizes(mTcpBufferSizes); } } + + WifiConfiguration config = getCurrentWifiConfiguration(); + ScanDetailCache scanDetailCache = + mWifiConfigManager.getScanDetailCacheForNetwork(config.networkId); + ScanResult scanResult = null; + if (scanDetailCache != null && mLastBssid != null) { + scanResult = scanDetailCache.getScanResult(mLastBssid); + } + final ProvisioningConfiguration prov; + ProvisioningConfiguration.ScanResultInfo scanResultInfo = null; + if (scanResult != null) { + final List<ScanResultInfo.InformationElement> ies = + new ArrayList<ScanResultInfo.InformationElement>(); + for (ScanResult.InformationElement ie : scanResult.getInformationElements()) { + ScanResultInfo.InformationElement scanResultInfoIe = + new ScanResultInfo.InformationElement(ie.getId(), ie.getBytes()); + ies.add(scanResultInfoIe); + } + scanResultInfo = new ProvisioningConfiguration.ScanResultInfo(scanResult.SSID, ies); + } + if (!isUsingStaticIp) { prov = new ProvisioningConfiguration.Builder() .withPreDhcpAction() .withApfCapabilities(mWifiNative.getApfCapabilities(mInterfaceName)) .withNetwork(getCurrentNetwork()) + .withScanResultInfo(scanResultInfo) .withDisplayName(currentConfig.SSID) .build(); } else { |