From 911facd2a26141efe5f242e11a07a9d84a45749a Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 6 Apr 2017 10:32:28 -0700 Subject: SupplicantStaIfaceHal: Change the order of broadcasts WifiStateMachine has some assumptions on the order of broadcasts received. It expects the STATE_CHANGE broadcast before NETWORK_CONNECTION one. This was true in the old socket interface ordering of events. So, restore that ordering. This reordering was causing WSM to not set the |meteredHint| and |ephemeral| flags in WifiInfo. Bug: 36840555 Test: Unit tests Change-Id: I26352317f755e114489501c6b7de95c61e06c7d0 --- service/java/com/android/server/wifi/SupplicantStaIfaceHal.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java index f21c75490..9c9501b3b 100644 --- a/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java +++ b/service/java/com/android/server/wifi/SupplicantStaIfaceHal.java @@ -1841,13 +1841,13 @@ public class SupplicantStaIfaceHal { WifiSsid wifiSsid = WifiSsid.createFromByteArray(NativeUtil.byteArrayFromArrayList(ssid)); String bssidStr = NativeUtil.macAddressFromByteArray(bssid); - mWifiMonitor.broadcastSupplicantStateChangeEvent( - mIfaceName, mFrameworkNetworkId, wifiSsid, bssidStr, newSupplicantState); + mStateIsFourway = (newState == ISupplicantStaIfaceCallback.State.FOURWAY_HANDSHAKE); if (newSupplicantState == SupplicantState.COMPLETED) { mWifiMonitor.broadcastNetworkConnectionEvent( mIfaceName, mFrameworkNetworkId, bssidStr); } - mStateIsFourway = (newState == ISupplicantStaIfaceCallback.State.FOURWAY_HANDSHAKE); + mWifiMonitor.broadcastSupplicantStateChangeEvent( + mIfaceName, mFrameworkNetworkId, wifiSsid, bssidStr, newSupplicantState); } } -- cgit v1.2.3 From d5a56317c4697aab6fc8c277ba33dbce6542db79 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Wed, 12 Apr 2017 17:13:28 -0700 Subject: SupplicantP2pIfaceCallback: Remove quotes around network name This is needed to maintain backward compatibility with previous releases. Bug: 37286961 Test: Unit tests Change-Id: Ie40bfecfbb302cb4f5e93695d9a2e60f8c405c56 --- .../java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'service') diff --git a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java index 836898d7f..5f4cb1773 100644 --- a/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java +++ b/service/java/com/android/server/wifi/p2p/SupplicantP2pIfaceCallback.java @@ -271,7 +271,8 @@ public class SupplicantP2pIfaceCallback extends ISupplicantP2pIfaceCallback.Stub group.setInterface(groupIfName); try { - group.setNetworkName(NativeUtil.encodeSsid(ssid)); + String quotedSsid = NativeUtil.encodeSsid(ssid); + group.setNetworkName(NativeUtil.removeEnclosingQuotes(quotedSsid)); } catch (Exception e) { Log.e(TAG, "Could not encode SSID.", e); return; -- cgit v1.2.3