Home
last modified time | relevance | path

Searched refs:PermissionHelper (Results 1 – 25 of 43) sorted by relevance

12

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DPermissionHelperTest.java105 assertThat(PermissionHelper.hasAccessAdServicesStatePermission(mockContext)).isTrue();
110 assertThat(PermissionHelper.hasAccessAdServicesStatePermission(mockContext1)).isTrue();
118 assertThat(PermissionHelper.hasModifyAdServicesStatePermission(mockContext)).isTrue();
123 assertThat(PermissionHelper.hasModifyAdServicesStatePermission(mockContext1)).isTrue();
131 assertThat(PermissionHelper.hasUpdateAdIdCachePermission(mockContextGrant)).isTrue();
136 assertThat(PermissionHelper.hasUpdateAdIdCachePermission(mockContextDeny)).isFalse();
145 assertThat(PermissionHelper.hasUpdateAdIdCachePermission(mockContextGrant)).isTrue();
150 assertThat(PermissionHelper.hasUpdateAdIdCachePermission(mockContextDeny)).isFalse();
158 PermissionHelper.hasTopicsPermission(
163 PermissionHelper.hasAdIdPermission(
[all …]
DAdServicesCommonServiceImplTest.java102 @SpyStatic(PermissionHelper.class)
588 .when(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_unauthorizedCaller()
593 ExtendedMockito.verify(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_unauthorizedCaller()
604 .when(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_apiDisabled()
610 ExtendedMockito.verify(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_apiDisabled()
620 .when(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_engineStarted()
628 ExtendedMockito.verify(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_engineStarted()
638 .when(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_extServicesPackage_initializesComponents()
655 ExtendedMockito.verify(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_extServicesPackage_initializesComponents()
667 .when(() -> PermissionHelper.hasModifyAdServicesStatePermission(any())); in enableAdServicesTest_tPlus_adServicesPackage_skipBackCompatInit()
[all …]
DFledgeAuthorizationFilterTest.java77 @MockStatic(PermissionHelper.class)
195 when(PermissionHelper.hasPermission( in testAssertAppHasCaPermission_appHasPermission()
220 when(PermissionHelper.hasPermission( in testAssertAppHasPasPermission_appHasPermission()
244 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasAllPermissions()
247 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasAllPermissions()
250 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasAllPermissions()
278 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasOnePermission()
281 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasOnePermission()
284 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasOnePermission()
312 when(PermissionHelper.hasPermission( in testAssertAppHasAnyPermission_appHasTwoPermissions()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DPermissionHelperTest.java56 PermissionHelper.hasAtLeastOnePermissionGranted(mContext, PERMISSION1, in testHasAtLeastOnePermission_none()
67 PermissionHelper.hasAtLeastOnePermissionGranted(mContext, PERMISSION1, in testHasAtLeastOnePermission_one()
78 PermissionHelper.hasAtLeastOnePermissionGranted(mContext, PERMISSION1, in testHasAtLeastOnePermission_both()
88 SecurityException exception = assertThrows(SecurityException.class, () -> PermissionHelper in testCheckHasAtLeastOnePermission_none()
99 PermissionHelper.checkHasAtLeastOnePermissionGranted(mContext, MESSAGE, PERMISSION1, in testCheckHasAtLeastOnePermissionGranted_one()
108 PermissionHelper.checkHasAtLeastOnePermissionGranted(mContext, MESSAGE, PERMISSION1, in testCheckHasAtLeastOnePermissionGranted_both()
117 () -> PermissionHelper.checkHasDumpPermissionGranted(mContext, MESSAGE)); in testCheckHasDumpPermissionGranted_notGranted()
127 PermissionHelper.checkHasDumpPermissionGranted(mContext, MESSAGE); in testCheckHasDumpPermissionGranted_granted()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/
DAdIdFetcherTest.java35 import com.android.adservices.service.common.PermissionHelper;
48 @MockStatic(PermissionHelper.class)
110 Mockito.when(PermissionHelper.hasAdIdPermission(mContext, CALLER_PACKAGE_NAME, CALLER_UID)) in testIsLimitedTrackingEnabled_PermissionsNotDeclared_ReturnsDefault()
129 Mockito.when(PermissionHelper.hasAdIdPermission(mContext, CALLER_PACKAGE_NAME, CALLER_UID)) in testIsLimitedTrackingEnabled_Disabled_ReturnsFalse()
148 Mockito.when(PermissionHelper.hasAdIdPermission(mContext, CALLER_PACKAGE_NAME, CALLER_UID)) in testIsLimitedTrackingEnabled_LatEnabled_ReturnsTrue()
167 Mockito.when(PermissionHelper.hasAdIdPermission(mContext, CALLER_PACKAGE_NAME, CALLER_UID)) in testIsLimitedTrackingEnabled_AdIdZeroedOut_ReturnsDefault()
186 Mockito.when(PermissionHelper.hasAdIdPermission(mContext, CALLER_PACKAGE_NAME, CALLER_UID)) in testIsLimitedTrackingEnabled_TimeoutException_ReturnsDefault()
206 Mockito.when(PermissionHelper.hasAdIdPermission(mContext, CALLER_PACKAGE_NAME, CALLER_UID)) in testIsLimitedTrackingEnabled_OnError_ReturnsDefault()
DReportAndRegisterEventE2ETest.java97 import com.android.adservices.service.common.PermissionHelper;
274 .mockStatic(PermissionHelper.class) in setup()
642 PermissionHelper.hasAttributionPermission( in testService_ReportingAndRegisteringEnabled_measurementConsentRevoked()
692 PermissionHelper.hasAttributionPermission( in testService_ReportingAndRegisteringEnabled_noPermissionForARA()
919 PermissionHelper.hasAttributionPermission( in testService_ReportingAndRegisteringFallbackEnabled_measurementConsentRevoked()
980 PermissionHelper.hasAttributionPermission( in testService_ReportingAndRegisteringFallbackEnabled_noPermissionForARA()
1124 PermissionHelper.hasAttributionPermission( in enableMeasurementConsentAndARAPermission()
DReportAndRegisterEventImplTest.java81 import com.android.adservices.service.common.PermissionHelper;
191 .mockStatic(PermissionHelper.class) in setup()
952 PermissionHelper.hasAttributionPermission( in testImpl_onlyReportsEvent_measurementConsentRevoked()
998 PermissionHelper.hasAttributionPermission( in testImpl_onlyReportsEvent_noPermissionForARA()
1190 PermissionHelper.hasAttributionPermission( in enableARA()
/packages/services/Car/car-builtin-lib/src/android/car/builtin/
DPermissionHelper.java27 public final class PermissionHelper { class
28 private PermissionHelper() { in PermissionHelper() method in PermissionHelper
/packages/services/Car/service/src/com/android/car/
DPermissionHelper.java27 public final class PermissionHelper { class
69 private PermissionHelper() { in PermissionHelper() method in PermissionHelper
/packages/modules/HealthFitness/tests/cts/route/src/android/healthconnect/cts/route/
DExerciseRouteTestHelper.java23 import static android.healthconnect.cts.utils.PermissionHelper.READ_EXERCISE_ROUTES;
24 import static android.healthconnect.cts.utils.PermissionHelper.READ_EXERCISE_ROUTE_PERMISSION;
25 import static android.healthconnect.cts.utils.PermissionHelper.getGrantedHealthPermissions;
DExerciseRouteNoReadWritePermissionTest.java30 import static android.healthconnect.cts.utils.PermissionHelper.READ_EXERCISE_ROUTES;
31 import static android.healthconnect.cts.utils.PermissionHelper.runWithRevokedPermissions;
/packages/modules/HealthFitness/tests/cts/src/android/healthconnect/cts/nopermission/
DHealthConnectManagerNotAllPermissionsAreGrantedTest.java31 import static android.healthconnect.cts.utils.PermissionHelper.grantPermissions;
32 import static android.healthconnect.cts.utils.PermissionHelper.revokeAllPermissions;
33 import static android.healthconnect.cts.utils.PermissionHelper.revokePermission;
DHealthConnectManagerNoPermissionsGrantedTest.java40 import static android.healthconnect.cts.utils.PermissionHelper.grantPermission;
41 import static android.healthconnect.cts.utils.PermissionHelper.revokeAllPermissions;
/packages/modules/HealthFitness/tests/cts/src/android/healthconnect/cts/ui/
DExerciseRouteRequestTest.kt34 import android.healthconnect.cts.utils.PermissionHelper.READ_EXERCISE_ROUTES
35 import android.healthconnect.cts.utils.PermissionHelper.getDeclaredHealthPermissions
36 import android.healthconnect.cts.utils.PermissionHelper.grantPermission
37 import android.healthconnect.cts.utils.PermissionHelper.runWithDeviceConfigForController
38 import android.healthconnect.cts.utils.PermissionHelper.runWithRevokedPermission
39 import android.healthconnect.cts.utils.PermissionHelper.runWithUserFixedPermission
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/
DPermissionHelper.java35 public final class PermissionHelper { class
36 private PermissionHelper() {} in PermissionHelper() method in PermissionHelper
DAdServicesCommonServiceImpl.java144 PermissionHelper.hasAccessAdServicesStatePermission(mContext); in isAdServicesEnabled()
204 PermissionHelper.hasModifyAdServicesStatePermission(mContext); in setAdServicesEnabled()
319 boolean authorizedCaller = PermissionHelper.hasModifyAdServicesStatePermission(mContext); in enableAdServices()
377 boolean authorizedCaller = PermissionHelper.hasUpdateAdIdCachePermission(mContext); in updateAdIdCache()
431 PermissionHelper.hasAccessAdServicesCommonStatePermission(mContext, packageName); in getAdServicesCommonStates()
DFledgeAuthorizationFilter.java146 if (!PermissionHelper.hasPermission(context, appPackageName, permission)) { in assertAppDeclaredPermission()
171 if (PermissionHelper.hasPermission(context, appPackageName, permission)) { in assertAppDeclaredAnyPermission()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/
DAdIdFetcher.java32 import com.android.adservices.service.common.PermissionHelper;
98 PermissionHelper.hasAdIdPermission(mContext, packageName, callingUid); in isLimitedAdTrackingEnabled()
DReportAndRegisterEventImpl.java35 import com.android.adservices.service.common.PermissionHelper;
223 if (!PermissionHelper.hasAttributionPermission(mContext, input.getCallerPackageName())) { in canMeasurementRegisterAndReport()
/packages/modules/HealthFitness/tests/integrationtests/src/android/healthconnect/tests/backuprestore/
DBackupRestoreE2ETest.java19 import static android.healthconnect.cts.utils.PermissionHelper.getHealthDataHistoricalAccessStartDa…
20 import static android.healthconnect.cts.utils.PermissionHelper.grantPermission;
21 import static android.healthconnect.cts.utils.PermissionHelper.revokeAllPermissions;
22 import static android.healthconnect.cts.utils.PermissionHelper.revokeAllPermissionsWithDelay;
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/measurement/
DMeasurementServiceImpl.java61 import com.android.adservices.service.common.PermissionHelper;
176 PermissionHelper.hasAttributionPermission(mContext, request.getAppPackageName()); in register()
237 PermissionHelper.hasAttributionPermission(mContext, request.getAppPackageName()); in registerWebSource()
322 PermissionHelper.hasAttributionPermission( in registerSource()
363 PermissionHelper.hasAttributionPermission(mContext, request.getAppPackageName()); in registerWebTrigger()
/packages/modules/HealthFitness/tests/cts/utils/HealthConnectTestUtils/src/android/healthconnect/cts/utils/
DRevokedHealthPermissionRule.java19 import static android.healthconnect.cts.utils.PermissionHelper.getGrantedHealthPermissions;
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adid/
DAdIdServiceImpl.java53 import com.android.adservices.service.common.PermissionHelper;
117 PermissionHelper.hasAdIdPermission(mContext, packageName, callingUid); in getAdId()
/packages/modules/HealthFitness/tests/cts/hostsidetests/healthconnect/device/src/android/healthconnect/cts/device/
DHealthConnectDeviceTest.java35 import static android.healthconnect.cts.utils.PermissionHelper.getGrantedHealthPermissions;
36 import static android.healthconnect.cts.utils.PermissionHelper.grantPermission;
37 import static android.healthconnect.cts.utils.PermissionHelper.revokeAndThenGrantHealthPermissions;
38 import static android.healthconnect.cts.utils.PermissionHelper.revokeHealthPermissions;
39 import static android.healthconnect.cts.utils.PermissionHelper.revokePermission;
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/topics/
DTopicsServiceImpl.java70 import com.android.adservices.service.common.PermissionHelper;
150 PermissionHelper.hasTopicsPermission(mContext, packageName, callingUid); in getTopics()

12