/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/ |
D | Throttler.java | 42 public enum ApiKey { enum in Throttler 118 private final ConcurrentHashMap<Pair<ApiKey, String>, RateLimiter> mSdkRateLimitMap = 125 private final Map<ApiKey, Double> mRateLimitPerApiMap = new HashMap<>(); 162 public boolean tryAcquire(ApiKey apiKey, String requester) { in tryAcquire() 180 for (var key : ApiKey.values()) { in setRateLimitPerApiMap() 221 mRateLimitPerApiMap.put(ApiKey.ADID_API_APP_PACKAGE_NAME, adIdPermitsPerSecond); in setRateLimitPerApiMap() 222 mRateLimitPerApiMap.put(ApiKey.APPSETID_API_APP_PACKAGE_NAME, appSetIdPermitsPerSecond); in setRateLimitPerApiMap() 224 mRateLimitPerApiMap.put(ApiKey.MEASUREMENT_API_REGISTER_SOURCE, registerSource); in setRateLimitPerApiMap() 225 mRateLimitPerApiMap.put(ApiKey.MEASUREMENT_API_REGISTER_TRIGGER, registerTrigger); in setRateLimitPerApiMap() 226 mRateLimitPerApiMap.put(ApiKey.MEASUREMENT_API_REGISTER_WEB_SOURCE, registerWebSource); in setRateLimitPerApiMap() [all …]
|
D | ProtectedSignalsServiceFilter.java | 70 @NonNull Throttler.ApiKey apiKey, in filterRequest() 105 @NonNull Throttler.ApiKey apiKey, in filterRequestAndExtractIdentifier()
|
D | CustomAudienceServiceFilter.java | 91 @NonNull Throttler.ApiKey apiKey, in filterRequest() 154 @NonNull Throttler.ApiKey apiKey, in filterRequestAndExtractIdentifier()
|
D | AbstractFledgeServiceFilter.java | 206 final String callerPackageName, Throttler.ApiKey apiKey, int apiName) in assertCallerNotThrottled() 232 @NonNull Throttler.ApiKey apiKey, in filterRequest()
|
D | FledgeApiThrottleFilter.java | 52 final String callerPackageName, Throttler.ApiKey apiKey, int apiName) in assertCallerNotThrottled()
|
D | AdSelectionServiceFilter.java | 81 @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.FLEDGE_API_FETCH_CUSTOM_AUDIEN… 22 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_GET_AD_SELECTION_DA… 23 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_JOIN_CUSTOM_AUDIENC… 24 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_LEAVE_CUSTOM_AUDIEN… 25 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_PERSIST_AD_SELECTIO… 26 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_REPORT_IMPRESSIONS; 27 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION; 28 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_SCHEDULE_CUSTOM_AUD… [all …]
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/protectedaudience/src/com/android/adservices/service/common/ |
D | CustomAudienceServiceFilterTest.java | 128 Throttler.ApiKey.UNKNOWN, in testFilterRequest_invalidPackageName_throws() 149 Throttler.ApiKey.UNKNOWN, in testFilterRequest_throttled_throws() 170 Throttler.ApiKey.UNKNOWN, in testFilterRequest_enforceForegroundTrue_foregroundCheckFails_throws() 188 Throttler.ApiKey.UNKNOWN, in testFilterRequest_enforceForegroundFalse_foregroundCheckFails_succeeds() 226 Throttler.ApiKey.UNKNOWN, in testFilterRequest_adTechNotAuthorized_throws() 254 Throttler.ApiKey.UNKNOWN, in testFilterRequest_withLocalhostDomain_doesNotPass() 268 Throttler.ApiKey.UNKNOWN, in testFilterRequest_withDeveloperMode_succeeds() 293 Throttler.ApiKey.UNKNOWN, in testFilterRequest_withLocalhostDomainInDeveloperMode_skipCheck() 310 Throttler.ApiKey.UNKNOWN, in testFilterRequest_nullAdTech_skipCheck() 334 Throttler.ApiKey.UNKNOWN, in testFilterRequest_appNotInAllowlist_throws() [all …]
|
D | AdSelectionServiceFilterTest.java | 125 Throttler.ApiKey.UNKNOWN, in testFilterRequest_noExceptionsThrown_succeeds() 143 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsCallerMismatchExceptionWithInvalidPackageName() 168 Throttler.ApiKey.UNKNOWN, in testFilterRequest_throttled_throwsLimitExceededException() 192 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsWrongCallingApplicationStateExceptionIfForegroundCheckFails() 213 Throttler.ApiKey.UNKNOWN, in testFilterRequestSucceedsForBackgroundAppsWhenEnforceForegroundFalse() 251 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsAdTechNotAllowedExceptionWhenAdTechNotAuthorized() 275 Throttler.ApiKey.UNKNOWN, in testFilterRequestThrowsAppNotAllowedExceptionWhenAppNotInAllowlist() 300 Throttler.ApiKey.UNKNOWN, in testFilterRequest_apiConsentRevoked_throwsRevokedConsentException() 322 Throttler.ApiKey.UNKNOWN, in testFilterRequest_apiConsentRevoked_enforceConsentFalse_succeeds() 336 Throttler.ApiKey.UNKNOWN, in testFilterRequestDoesNotDoEnrollmentCheckWhenAdTechParamIsNull() [all …]
|
D | ProtectedSignalsServiceFilterTest.java | 126 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_invalidPackageName_throws() 148 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_throttled_throws() 170 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceForegroundTrue_foregroundCheckFails() 199 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceForegroundFalse_foregroundCheckFails() 235 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enableEnrollmentCheck_invalidAdTech_throws() 252 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_disableEnrollmentCheck_eTLDPlus1NotExtracted() 295 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_appNotInAllowlist_throws() 319 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceConsentTrue_hasUserConsentForApp() 350 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceConsentTrue_lacksUserConsentForApp() 378 Throttler.ApiKey.UNKNOWN, in testFilterRequestAndExtractIdentifier_enforceConsentFalse_lacksUserConsentForApp() [all …]
|
D | FledgeApiThrottleFilterTest.java | 63 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testAssertCallerNotThrottled_notThrottled_doesNotThrowOrLogError() 83 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 | 203 final Throttler.ApiKey apiKey = getApiKey(request); in register() 281 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_REGISTER_WEB_SOURCE; in registerWebSource() 356 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_REGISTER_SOURCES; in registerSource() 425 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_REGISTER_WEB_TRIGGER; in registerWebTrigger() 496 final Throttler.ApiKey apiKey = Throttler.ApiKey.MEASUREMENT_API_DELETION_REGISTRATION; in deleteRegistrations() 722 String appPackageName, Throttler.ApiKey apiKey, IMeasurementCallback callback) { in isThrottled() 884 private Throttler.ApiKey getApiKey(RegistrationRequest request) { in getApiKey() 886 ? Throttler.ApiKey.MEASUREMENT_API_REGISTER_SOURCE in getApiKey() 887 : Throttler.ApiKey.MEASUREMENT_API_REGISTER_TRIGGER; in getApiKey()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/protectedaudience/src/com/android/adservices/service/customaudience/ |
D | FetchCustomAudienceImplTest.java | 277 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in setup() 291 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in setup() 367 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_invalidPackageName_throws() 406 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_throttled_throws() 445 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_failedForegroundCheck_throws() 485 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_failedEnrollmentCheck_throws() 526 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_appCannotUsePPAPI_throws() 563 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_revokedConsent_failsSilently() 599 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_revokedConsent_failsSilentlyUXNotificationDisabled() 627 Throttler.ApiKey.FLEDGE_API_FETCH_CUSTOM_AUDIENCE, in testImpl_revokedConsent_failsSilentlyUXNotificationDisabled() [all …]
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/protectedaudience/src/com/android/adservices/service/adselection/ |
D | OutcomeSelectionRunnerTest.java | 185 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in setup() 240 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testRunOutcomeSelectionRevokedUserConsentEmptyResult() 294 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testRunOutcomeSelectionRevokedUserConsentEmptyResult_UXNotificationNotEnforced() 358 Throttler.ApiKey.FLEDGE_API_SELECT_ADS, in testRunOutcomeSelectionRevokedUserConsentEmptyResult_UXNotificationNotEnforced()
|
D | ReportAndRegisterEventImplTest.java | 577 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWithInvalidPackageName() 624 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenForegroundCheckFails() 674 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenThrottled() 732 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenAppNotInAllowList() 768 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsSilentlyWithoutConsent()
|
D | AppInstallAdvertisersSetterTest.java | 135 Throttler.ApiKey.FLEDGE_API_SET_APP_INSTALL_ADVERTISERS, in testSetAppInstallAdvertisersSuccess() 172 Throttler.ApiKey.FLEDGE_API_SET_APP_INSTALL_ADVERTISERS, in testSetAppInstallAdvertisersSuccessWithUxNotificationEnforcementDisabled()
|
D | ReportEventImplTest.java | 430 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplSuccessfullyReportsRegisteredInteractionsWithUXNotificationEnforcementDisabled() 1024 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWithInvalidPackageName() 1097 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenForegroundCheckFails() 1209 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenThrottled() 1281 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenAppNotInAllowList() 1344 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsSilentlyWithoutConsent()
|
D | ReportAndRegisterEventFallbackImplTest.java | 820 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWithInvalidPackageName() 877 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenForegroundCheckFails() 937 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenThrottled() 1021 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsWhenAppNotInAllowList() 1067 Throttler.ApiKey.FLEDGE_API_REPORT_INTERACTION, in testImplFailsSilentlyWithoutConsent()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/appsetid/src/com/android/adservices/service/appsetid/ |
D | AppSetIdServiceImplTest.java | 119 eq(Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME), anyString())) in setup() 149 eq(Throttler.ApiKey.APPSETID_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/adid/src/com/android/adservices/service/adid/ |
D | AdIdServiceImplTest.java | 134 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME), anyString())) in setup() 162 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
|
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/topics/ |
D | TopicsServiceImpl.java | 264 Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, in isThrottled() 267 Throttler.ApiKey.TOPICS_API_SDK_NAME, topicsParam.getSdkName()); in isThrottled()
|
/packages/modules/AdServices/adservices/tests/unittest/service-core/topics/src/com/android/adservices/service/topics/ |
D | TopicsServiceImplTest.java | 267 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.TOPICS_API_SDK_NAME), anyString())) in setup() 270 eq(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME), anyString())) in setup() 366 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.TOPICS_API_SDK_NAME), anyString())) in checkThrottler_rateLimitReached_forSdkName() 385 eq(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
|
/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/adselection/ |
D | AppInstallAdvertisersSetter.java | 22 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_SET_APP_INSTALL_ADV…
|
D | UpdateAdCounterHistogramWorker.java | 26 import static com.android.adservices.service.common.Throttler.ApiKey.FLEDGE_API_UPDATE_AD_COUNTER_H…
|