From 96031c2d3095fe14578e4c07eadf5151c07ebddc Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Fri, 26 Apr 2019 08:29:55 -0700 Subject: ScanRequestProxy: Log package name in worksource Helps differentiate scan initiating apps better in bugreport. Bug: 123404912 Test: atest com.android.server.wifi Test: Manual scan log inspection in wifiscanner dumpsys Change-Id: I74a3bbea40c09346c795d0787407cd57b3af5786 --- .../src/com/android/server/wifi/ScanRequestProxyTest.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java b/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java index a19640ff6..985789858 100644 --- a/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ScanRequestProxyTest.java @@ -173,7 +173,8 @@ public class ScanRequestProxyTest { mInOrder.verify(mWifiScanner).registerScanListener(any()); mInOrder.verify(mWifiScanner).startScan(any(), any(), any()); - assertTrue(mWorkSourceArgumentCaptor.getValue().equals(new WorkSource(TEST_UID))); + assertTrue(mWorkSourceArgumentCaptor.getValue().equals( + new WorkSource(TEST_UID, TEST_PACKAGE_NAME_1))); validateScanSettings(mScanSettingsArgumentCaptor.getValue(), false); verify(mWifiMetrics).incrementExternalAppOneshotScanRequestsCount(); @@ -189,7 +190,8 @@ public class ScanRequestProxyTest { mInOrder.verify(mWifiScanner).registerScanListener(any()); mInOrder.verify(mWifiScanner).startScan(any(), any(), any()); - assertTrue(mWorkSourceArgumentCaptor.getValue().equals(new WorkSource(TEST_UID))); + assertTrue(mWorkSourceArgumentCaptor.getValue().equals( + new WorkSource(TEST_UID, TEST_PACKAGE_NAME_1))); validateScanSettings(mScanSettingsArgumentCaptor.getValue(), false, true); } @@ -203,7 +205,8 @@ public class ScanRequestProxyTest { mInOrder.verify(mWifiScanner).registerScanListener(any()); mInOrder.verify(mWifiScanner).startScan(any(), any(), any()); - assertTrue(mWorkSourceArgumentCaptor.getValue().equals(new WorkSource(TEST_UID))); + assertTrue(mWorkSourceArgumentCaptor.getValue().equals( + new WorkSource(TEST_UID, TEST_PACKAGE_NAME_1))); validateScanSettings(mScanSettingsArgumentCaptor.getValue(), false, true); } @@ -221,7 +224,8 @@ public class ScanRequestProxyTest { mInOrder.verify(mWifiConfigManager, never()).retrieveHiddenNetworkList(); mInOrder.verify(mWifiScanner).startScan(any(), any(), any()); - assertTrue(mWorkSourceArgumentCaptor.getValue().equals(new WorkSource(TEST_UID))); + assertTrue(mWorkSourceArgumentCaptor.getValue().equals( + new WorkSource(TEST_UID, TEST_PACKAGE_NAME_1))); validateScanSettings(mScanSettingsArgumentCaptor.getValue(), false); verify(mWifiMetrics).incrementExternalAppOneshotScanRequestsCount(); @@ -241,7 +245,8 @@ public class ScanRequestProxyTest { mInOrder.verify(mWifiConfigManager).retrieveHiddenNetworkList(); mInOrder.verify(mWifiScanner).startScan(any(), any(), any()); - assertTrue(mWorkSourceArgumentCaptor.getValue().equals(new WorkSource(TEST_UID))); + assertTrue(mWorkSourceArgumentCaptor.getValue().equals( + new WorkSource(TEST_UID, TEST_PACKAGE_NAME_1))); validateScanSettings(mScanSettingsArgumentCaptor.getValue(), true); verify(mWifiMetrics).incrementExternalAppOneshotScanRequestsCount(); -- cgit v1.2.3