From c7f7a636e55d4f2acbbc7f5f6b85c4f1d3b69cac Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 16 Apr 2020 18:30:14 -0700 Subject: WifiServiceImpl: Always Use enforceCallingOrSelfPermission Bug: 154276058 Test: atest com.android.server.wifi Change-Id: Ibfd392d0ee9ffe9c4983589c499990da721068e2 --- .../src/com/android/server/wifi/WifiServiceImplTest.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (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 fcc290560..a11fc6dcb 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -4602,7 +4602,7 @@ public class WifiServiceImplTest extends WifiBaseTest { @Test public void setDeviceMobilityStateThrowsSecurityExceptionOnMissingPermissions() { doThrow(new SecurityException()).when(mContext) - .enforceCallingPermission( + .enforceCallingOrSelfPermission( eq(android.Manifest.permission.WIFI_SET_DEVICE_MOBILITY_STATE), eq("WifiService")); try { @@ -4630,7 +4630,7 @@ public class WifiServiceImplTest extends WifiBaseTest { @Test public void testAddStatsListenerThrowsSecurityExceptionOnMissingPermissions() { doThrow(new SecurityException()).when(mContext) - .enforceCallingPermission( + .enforceCallingOrSelfPermission( eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE), eq("WifiService")); try { @@ -4662,7 +4662,7 @@ public class WifiServiceImplTest extends WifiBaseTest { @Test public void testRemoveStatsListenerThrowsSecurityExceptionOnMissingPermissions() { doThrow(new SecurityException()).when(mContext) - .enforceCallingPermission( + .enforceCallingOrSelfPermission( eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE), eq("WifiService")); try { @@ -4703,7 +4703,7 @@ public class WifiServiceImplTest extends WifiBaseTest { @Test public void testUpdateWifiUsabilityScoreThrowsSecurityExceptionOnMissingPermissions() { doThrow(new SecurityException()).when(mContext) - .enforceCallingPermission( + .enforceCallingOrSelfPermission( eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE), eq("WifiService")); try { @@ -5475,7 +5475,7 @@ public class WifiServiceImplTest extends WifiBaseTest { @Test public void testSetNetworkScorerThrowsSecurityExceptionOnMissingPermissions() { doThrow(new SecurityException()).when(mContext) - .enforceCallingPermission( + .enforceCallingOrSelfPermission( eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE), eq("WifiService")); try { @@ -5505,7 +5505,7 @@ public class WifiServiceImplTest extends WifiBaseTest { @Test public void testClearNetworkScorerThrowsSecurityExceptionOnMissingPermissions() { doThrow(new SecurityException()).when(mContext) - .enforceCallingPermission( + .enforceCallingOrSelfPermission( eq(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE), eq("WifiService")); try { -- cgit v1.2.3