summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorxshu <xshu@google.com>2020-08-11 19:17:44 -0700
committerxshu <xshu@google.com>2020-09-02 16:30:56 -0700
commit4036c533b3da963ef103a923037ca944e3c283ea (patch)
tree4bf900d741404e875827522bf6e8df696ecd939a /tests
parentedc209e114cb84977b592bd4ef2fe8203a68951c (diff)
Breakdown manual connection events
(cherry-picked from ebf39c906b8f2afe499f96e6f33379ba110fc194) Adding a new event type, EVENT_ADD_OR_UPDATE_NETWORK to track adding new networks and modifying credentials for existing networks. Bug: 163663606 Test: atest com.android.server.wifi Test: Manual sanity test Updated-pdd: TRUE Change-Id: If2c611b50c03463d4041d6b1bd96778b2d567469 Merged-In: If2c611b50c03463d4041d6b1bd96778b2d567469
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
index 6d1ae2927..49ccf9bd3 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java
@@ -3621,7 +3621,8 @@ public class WifiServiceImplTest extends WifiBaseTest {
mock(IActionListener.class), 0);
verify(mClientModeImpl).connect(any(WifiConfiguration.class), anyInt(),
any(Binder.class), any(IActionListener.class), anyInt(), anyInt());
- verify(mWifiMetrics).logUserActionEvent(eq(UserActionEvent.EVENT_MANUAL_CONNECT), anyInt());
+ verify(mWifiMetrics).logUserActionEvent(eq(UserActionEvent.EVENT_ADD_OR_UPDATE_NETWORK),
+ anyInt());
}
/**
@@ -3632,8 +3633,11 @@ public class WifiServiceImplTest extends WifiBaseTest {
public void testSaveNetworkWithPrivilegedPermission() throws Exception {
when(mContext.checkPermission(eq(android.Manifest.permission.NETWORK_SETTINGS),
anyInt(), anyInt())).thenReturn(PackageManager.PERMISSION_GRANTED);
+ when(mWifiPermissionsUtil.checkNetworkSettingsPermission(anyInt())).thenReturn(true);
mWifiServiceImpl.save(mock(WifiConfiguration.class), mock(Binder.class),
mock(IActionListener.class), 0);
+ verify(mWifiMetrics).logUserActionEvent(eq(UserActionEvent.EVENT_ADD_OR_UPDATE_NETWORK),
+ anyInt());
verify(mClientModeImpl).save(any(WifiConfiguration.class),
any(Binder.class), any(IActionListener.class), anyInt(), anyInt());
}