From 27991984fa79c0a1656df9d63cae951bbdb74ad1 Mon Sep 17 00:00:00 2001 From: Chalard Jean Date: Tue, 8 May 2018 17:16:57 +0900 Subject: Make the SSID known to ConnectivityService immediately. This will help ConnectivityService with more helpful logging. Bug: 78547904 Test: manual Change-Id: Ic915796f401a72c5577153cad16b55e8e096d8b0 --- service/java/com/android/server/wifi/WifiStateMachine.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 4a0a24a21..fe3aa94ae 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -4740,9 +4740,15 @@ public class WifiStateMachine extends StateMachine { } setNetworkDetailedState(DetailedState.CONNECTING); + final NetworkCapabilities nc; + if (mWifiInfo != null && !mWifiInfo.getSSID().equals(WifiSsid.NONE)) { + nc = new NetworkCapabilities(mNetworkCapabilitiesFilter); + nc.setSSID(mWifiInfo.getSSID()); + } else { + nc = mNetworkCapabilitiesFilter; + } mNetworkAgent = new WifiNetworkAgent(getHandler().getLooper(), mContext, - "WifiNetworkAgent", mNetworkInfo, mNetworkCapabilitiesFilter, - mLinkProperties, 60, mNetworkMisc); + "WifiNetworkAgent", mNetworkInfo, nc, mLinkProperties, 60, mNetworkMisc); // We must clear the config BSSID, as the wifi chipset may decide to roam // from this point on and having the BSSID specified in the network block would -- cgit v1.2.3