summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-03-14 08:54:56 -0700
committerRoshan Pius <rpius@google.com>2017-03-14 10:19:33 -0700
commita1727e40dc6b2742df5b32451f1dfa787fc6aa98 (patch)
treead7d56c0caee303736d010cc75781205e98b4dcb /tests
parent9ca3944e48689ee1d72eed1ed27bc19ecea2c039 (diff)
WifiStateMachine: Note user selection only for settings app
The previous CL for this bug also modified the user selection when we let non-settings app to initiate connection. This bug CL reverts that, non-settings app can only initiate connection, but not set user connect choice. Bug: 36040264 Test: Unit tests Change-Id: If70fe974274277bd804f5cc17a5751dee76f44e3
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index f77db43a4..c9bc3d657 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -811,6 +811,8 @@ public class WifiStateMachineTest {
@Test
public void connect() throws Exception {
addNetworkAndVerifySuccess();
+ when(mWifiConfigManager.enableNetwork(eq(0), eq(true), anyInt())).thenReturn(true);
+ when(mWifiConfigManager.checkAndUpdateLastConnectUid(eq(0), anyInt())).thenReturn(true);
mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE);
mLooper.dispatchAll();
@@ -820,6 +822,7 @@ public class WifiStateMachineTest {
mLooper.stopAutoDispatch();
verify(mWifiConfigManager).enableNetwork(eq(0), eq(true), anyInt());
+ verify(mWifiConnectivityManager).setUserConnectChoice(eq(0));
mWsm.sendMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, sBSSID);
mLooper.dispatchAll();
@@ -856,6 +859,7 @@ public class WifiStateMachineTest {
mLooper.stopAutoDispatch();
verify(mWifiConfigManager).enableNetwork(eq(0), eq(true), anyInt());
+ verify(mWifiConnectivityManager, never()).setUserConnectChoice(eq(0));
mWsm.sendMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, sBSSID);
mLooper.dispatchAll();