/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/ |
D | Throttler.java | 36 public enum ApiKey { enum in Throttler 110 private final ConcurrentHashMap<Pair<ApiKey, String>, RateLimiter> mSdkRateLimitMap = 117 private final Map<ApiKey, Double> mRateLimitPerApiMap = new HashMap<>(); 157 public boolean tryAcquire(ApiKey apiKey, String requester) { in tryAcquire() 189 mRateLimitPerApiMap.put(ApiKey.UNKNOWN, defaultPermitsPerSecond); in setRateLimitPerApiMap() 191 mRateLimitPerApiMap.put(ApiKey.ADID_API_APP_PACKAGE_NAME, adIdPermitsPerSecond); in setRateLimitPerApiMap() 192 mRateLimitPerApiMap.put(ApiKey.APPSETID_API_APP_PACKAGE_NAME, appSetIdPermitsPerSecond); in setRateLimitPerApiMap() 194 mRateLimitPerApiMap.put(ApiKey.FLEDGE_API_JOIN_CUSTOM_AUDIENCE, defaultPermitsPerSecond); in setRateLimitPerApiMap() 195 mRateLimitPerApiMap.put(ApiKey.FLEDGE_API_LEAVE_CUSTOM_AUDIENCE, defaultPermitsPerSecond); in setRateLimitPerApiMap() 196 mRateLimitPerApiMap.put(ApiKey.FLEDGE_API_REPORT_IMPRESSIONS, defaultPermitsPerSecond); in setRateLimitPerApiMap() [all …]
|
D | ProtectedSignalsServiceFilter.java | 69 @NonNull Throttler.ApiKey apiKey, in filterRequest() 102 @NonNull Throttler.ApiKey apiKey, in filterRequestAndExtractIdentifier()
|
D | CustomAudienceServiceFilter.java | 89 @NonNull Throttler.ApiKey apiKey, in filterRequest() 148 @NonNull Throttler.ApiKey apiKey, in filterRequestAndExtractIdentifier()
|
D | AbstractFledgeServiceFilter.java | 190 final String callerPackageName, Throttler.ApiKey apiKey, int apiName) in assertCallerNotThrottled() 214 @NonNull Throttler.ApiKey apiKey, in filterRequest()
|
D | FledgeApiThrottleFilter.java | 49 final String callerPackageName, Throttler.ApiKey apiKey, int apiName) in assertCallerNotThrottled()
|
D | AdSelectionServiceFilter.java | 77 @NonNull Throttler.ApiKey apiKey, in filterRequest()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/ |
D | ThrottlerTest.java | 19 import static com.android.adservices.service.common.Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME; 20 import static com.android.adservices.service.common.Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME; 21 import static com.android.adservices.service.common.Throttler.ApiKey.MEASUREMENT_API_REGISTER_SOURC… 22 import static com.android.adservices.service.common.Throttler.ApiKey.MEASUREMENT_API_REGISTER_SOURC… 23 import static com.android.adservices.service.common.Throttler.ApiKey.MEASUREMENT_API_REGISTER_TRIGG… 24 import static com.android.adservices.service.common.Throttler.ApiKey.MEASUREMENT_API_REGISTER_WEB_S… 25 import static com.android.adservices.service.common.Throttler.ApiKey.MEASUREMENT_API_REGISTER_WEB_T… 26 import static com.android.adservices.service.common.Throttler.ApiKey.UNKNOWN; 51 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_skdName() 52 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isFalse(); in testTryAcquire_skdName() [all …]
|
D | CustomAudienceServiceFilterTest.java | 126 Throttler.ApiKey.UNKNOWN, in testFilterRequest_invalidPackageName_throws() 146 Throttler.ApiKey.UNKNOWN, in testFilterRequest_throttled_throws() 166 Throttler.ApiKey.UNKNOWN, in testFilterRequest_enforceForegroundTrue_foregroundCheckFails_throws() 183 Throttler.ApiKey.UNKNOWN, in testFilterRequest_enforceForegroundFalse_foregroundCheckFails_succeeds() 219 Throttler.ApiKey.UNKNOWN, in testFilterRequest_adTechNotAuthorized_throws() 245 Throttler.ApiKey.UNKNOWN, in testFilterRequest_withLocalhostDomain_doesNotPass() 258 Throttler.ApiKey.UNKNOWN, in testFilterRequest_withDeveloperMode_succeeds() 284 Throttler.ApiKey.UNKNOWN, in testFilterRequest_withLocalhostDomainInDeveloperMode_skipCheck() 303 Throttler.ApiKey.UNKNOWN, in testFilterRequest_nullAdTech_skipCheck() 326 Throttler.ApiKey.UNKNOWN, in testFilterRequest_appNotInAllowlist_throws() [all …]
|
D | AdSelectionServiceFilterTest.java | 124 Throttler.ApiKey.UNKNOWN, in testFilterRequest_noExceptionsThrown_succeeds() 141 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsCallerMismatchExceptionWithInvalidPackageName() 165 Throttler.ApiKey.UNKNOWN, in testFilterRequest_throttled_throwsLimitExceededException() 188 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsWrongCallingApplicationStateExceptionIfForegroundCheckFails() 208 Throttler.ApiKey.UNKNOWN, in testFilterRequestSucceedsForBackgroundAppsWhenEnforceForegroundFalse() 244 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsAdTechNotAllowedExceptionWhenAdTechNotAuthorized() 267 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsAppNotAllowedExceptionWhenAppNotInAllowlist() 291 Throttler.ApiKey.UNKNOWN, in testFilterRequest_apiConsentRevoked_throwsRevokedConsentException() 312 Throttler.ApiKey.UNKNOWN, in testFilterRequest_apiConsentRevoked_enforceConsentFalse_succeeds() 325 Throttler.ApiKey.UNKNOWN, in testFilterRequestDoesNotDoEnrollmentCheckWhenAdTechParamIsNull() [all …]
|
D | ProtectedSignalsServiceFilterTest.java | 118 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_invalidPackageName_throws() 139 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_throttled_throws() 160 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceForegroundTrue_foregroundCheckFails() 188 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceForegroundFalse_foregroundCheckFails() 223 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enableEnrollmentCheck_invalidAdTech_throws() 239 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_disableEnrollmentCheck_eTLDPlus1NotExtracted() 281 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_appNotInAllowlist_throws() 304 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceConsentTrue_hasUserConsentForApp() 334 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceConsentTrue_lacksUserConsentForApp() 361 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceConsentFalse_lacksUserConsentForApp()
|
D | FledgeApiThrottleFilterTest.java | 62 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testAssertCallerNotThrottled_notThrottled_doesNotThrowOrLogError() 77 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testAssertCallerNotThrottled_throttled_throwsAndLogsError()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/measurement/ |
D | MeasurementServiceImpl.java | 163 final Throttler.ApiKey apiKey = getApiKey(request); in register() 223 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_REGISTER_WEB_SOURCE; in registerWebSource() 289 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_REGISTER_SOURCES; in registerSource() 349 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_REGISTER_WEB_TRIGGER; in registerWebTrigger() 411 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_DELETION_REGISTRATION; in deleteRegistrations() 544 String appPackageName, Throttler.ApiKey apiKey, IMeasurementCallback callback) { in isThrottled() 706 private Throttler.ApiKey getApiKey(RegistrationRequest request) { in getApiKey() 708 ? Throttler.ApiKey.MEASUREMENT_API_REGISTER_SOURCE in getApiKey() 709 : Throttler.ApiKey.MEASUREMENT_API_REGISTER_TRIGGER; in getApiKey()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/customaudience/ |
D | FetchCustomAudienceImplTest.java | 240 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in setup() 252 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in setup() 322 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_invalidPackageName_throws() 354 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_throttled_throws() 386 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_failedForegroundCheck_throws() 419 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_failedEnrollmentCheck_throws() 452 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_appCannotUsePPAPI_throws() 485 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_revokedConsent_failsSilently() 966 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_runWithFailure_CallbackThrowsException()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/adselection/ |
D | ReportAndRegisterEventImplTest.java | 524 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWithInvalidPackageName() 566 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenForegroundCheckFails() 611 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenThrottled() 664 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenAppNotInAllowList() 699 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsSilentlyWithoutConsent()
|
D | ReportEventImplTest.java | 827 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWithInvalidPackageName() 895 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenForegroundCheckFails() 1002 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenThrottled() 1069 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenAppNotInAllowList() 1131 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsSilentlyWithoutConsent()
|
D | ReportAndRegisterEventFallbackImplTest.java | 775 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWithInvalidPackageName() 827 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenForegroundCheckFails() 882 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenThrottled() 961 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenAppNotInAllowList() 1006 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsSilentlyWithoutConsent()
|
D | OutcomeSelectionRunnerTest.java | 186 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in setup() 246 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testRunOutcomeSelectionRevokedUserConsentEmptyResult()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/appsetid/src/com/android/adservices/service/appsetid/ |
D | AppSetIdServiceImplTest.java | 127 eq(Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME), anyString())) in setup() 157 eq(Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/topics/ |
D | TopicsServiceImpl.java | 248 Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, in isThrottled() 251 Throttler.ApiKey.TOPICS_API_SDK_NAME, topicsParam.getSdkName()); in isThrottled()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/adid/src/com/android/adservices/service/adid/ |
D | AdIdServiceImplTest.java | 139 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME), anyString())) in setup() 167 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/topics/ |
D | TopicsServiceImplTest.java | 268 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.TOPICS_API_SDK_NAME), anyString())) in setup() 271 eq(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME), anyString())) in setup() 373 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.TOPICS_API_SDK_NAME), anyString())) in checkThrottler_rateLimitReached_forSdkName() 392 eq(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adselection/ |
D | AppInstallAdvertisersSetter.java | 22 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_SET_APP_INSTALL_ADV…
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/appsetid/ |
D | AppSetIdServiceImpl.java | 155 Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME, in isThrottled()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/ |
D | CustomAudienceServiceImpl.java | 22 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_JOIN_CUSTOM_AUDIENC… 23 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_LEAVE_CUSTOM_AUDIEN…
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/adid/ |
D | AdIdServiceImpl.java | 164 Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME, adIdParam.getAppPackageName()); in isThrottled()
|