Home
last modified time | relevance | path

Searched refs:ApiKey (Results 1 – 25 of 47) sorted by relevance

12

/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/
DThrottler.java36 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 …]
DProtectedSignalsServiceFilter.java69 @NonNull Throttler.ApiKey apiKey, in filterRequest()
102 @NonNull Throttler.ApiKey apiKey, in filterRequestAndExtractIdentifier()
DCustomAudienceServiceFilter.java89 @NonNull Throttler.ApiKey apiKey, in filterRequest()
148 @NonNull Throttler.ApiKey apiKey, in filterRequestAndExtractIdentifier()
DAbstractFledgeServiceFilter.java190 final String callerPackageName, Throttler.ApiKey apiKey, int apiName) in assertCallerNotThrottled()
214 @NonNull Throttler.ApiKey apiKey, in filterRequest()
DFledgeApiThrottleFilter.java49 final String callerPackageName, Throttler.ApiKey apiKey, int apiName) in assertCallerNotThrottled()
DAdSelectionServiceFilter.java77 @NonNull Throttler.ApiKey apiKey, in filterRequest()
/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DThrottlerTest.java19 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 …]
DCustomAudienceServiceFilterTest.java126 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 …]
DAdSelectionServiceFilterTest.java124 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 …]
DProtectedSignalsServiceFilterTest.java118 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()
DFledgeApiThrottleFilterTest.java62 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/
DMeasurementServiceImpl.java163 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/
DFetchCustomAudienceImplTest.java240 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/
DReportAndRegisterEventImplTest.java524 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()
DReportEventImplTest.java827 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()
DReportAndRegisterEventFallbackImplTest.java775 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()
DOutcomeSelectionRunnerTest.java186 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/
DAppSetIdServiceImplTest.java127 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/
DTopicsServiceImpl.java248 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/
DAdIdServiceImplTest.java139 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/
DTopicsServiceImplTest.java268 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/
DAppInstallAdvertisersSetter.java22 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/
DAppSetIdServiceImpl.java155 Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME, in isThrottled()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/customaudience/
DCustomAudienceServiceImpl.java22 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/
DAdIdServiceImpl.java164 Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME, adIdParam.getAppPackageName()); in isThrottled()

12