From 4036c533b3da963ef103a923037ca944e3c283ea Mon Sep 17 00:00:00 2001 From: xshu Date: Tue, 11 Aug 2020 19:17:44 -0700 Subject: 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 --- .../wifitests/src/com/android/server/wifi/WifiServiceImplTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') 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()); } -- cgit v1.2.3