summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-04-06 10:32:28 -0700
committerRoshan Pius <rpius@google.com>2017-04-11 17:26:37 -0700
commit911facd2a26141efe5f242e11a07a9d84a45749a (patch)
tree70df34fbc7d303519ca295448adf7bbe8a892a2e /tests
parent5ed0a08cce018a10dce2b84f7d818e0f12c09f15 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
index f1897c8b2..74bdfa1c2 100644
--- a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
@@ -898,6 +898,7 @@ public class SupplicantStaIfaceHalTest {
*/
@Test
public void testStateChangeToCompletedCallback() throws Exception {
+ InOrder wifiMonitorInOrder = inOrder(mWifiMonitor);
executeAndValidateInitializationSequence();
int frameworkNetworkId = 6;
executeAndValidateConnectSequence(frameworkNetworkId, false);
@@ -908,11 +909,11 @@ public class SupplicantStaIfaceHalTest {
NativeUtil.macAddressToByteArray(BSSID), SUPPLICANT_NETWORK_ID,
NativeUtil.decodeSsid(SUPPLICANT_SSID));
- verify(mWifiMonitor).broadcastSupplicantStateChangeEvent(
+ wifiMonitorInOrder.verify(mWifiMonitor).broadcastNetworkConnectionEvent(
+ eq(WLAN_IFACE_NAME), eq(frameworkNetworkId), eq(BSSID));
+ wifiMonitorInOrder.verify(mWifiMonitor).broadcastSupplicantStateChangeEvent(
eq(WLAN_IFACE_NAME), eq(frameworkNetworkId),
any(WifiSsid.class), eq(BSSID), eq(SupplicantState.COMPLETED));
- verify(mWifiMonitor).broadcastNetworkConnectionEvent(
- eq(WLAN_IFACE_NAME), eq(frameworkNetworkId), eq(BSSID));
}
/**