TestCustomAudienceManager
open class TestCustomAudienceManager
kotlin.Any | |
↳ | android.adservices.customaudience.TestCustomAudienceManager |
TestCustomAudienceManager provides APIs for app and ad-SDKs to test custom audiences.
Summary
Public methods | |
---|---|
open Unit |
overrideCustomAudienceRemoteInfo(request: AddCustomAudienceOverrideRequest, executor: Executor, receiver: OutcomeReceiver<Any!, Exception!>) Overrides the Custom Audience API to avoid fetching data from remote servers and use the data provided in |
open Unit |
removeCustomAudienceRemoteInfoOverride(request: RemoveCustomAudienceOverrideRequest, executor: Executor, receiver: OutcomeReceiver<Any!, Exception!>) Removes an override in th Custom Audience API with associated the data in |
open Unit |
resetAllCustomAudienceOverrides(executor: Executor, receiver: OutcomeReceiver<Any!, Exception!>) Removes all override data in the Custom Audience API. |
Public methods
overrideCustomAudienceRemoteInfo
open fun overrideCustomAudienceRemoteInfo(
request: AddCustomAudienceOverrideRequest,
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Overrides the Custom Audience API to avoid fetching data from remote servers and use the data provided in AddCustomAudienceOverrideRequest
instead. The AddCustomAudienceOverrideRequest
is provided by the Ads SDK.
This method is intended to be used for end-to-end testing. This API is enabled only for apps in debug mode with developer options enabled.
This call will fail silently if the owner
in the request
is not the calling app's package name.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE
Parameters | |
---|---|
request |
AddCustomAudienceOverrideRequest: This value cannot be null . |
executor |
Executor: This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
receiver |
OutcomeReceiver<Any!, Exception!>: This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if this API is not enabled for the caller
The receiver either returns a |
removeCustomAudienceRemoteInfoOverride
open fun removeCustomAudienceRemoteInfoOverride(
request: RemoveCustomAudienceOverrideRequest,
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Removes an override in th Custom Audience API with associated the data in RemoveCustomAudienceOverrideRequest
.
This method is intended to be used for end-to-end testing. This API is enabled only for apps in debug mode with developer options enabled.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE
Parameters | |
---|---|
request |
RemoveCustomAudienceOverrideRequest: This value cannot be null . |
executor |
Executor: This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
receiver |
OutcomeReceiver<Any!, Exception!>: This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if this API is not enabled for the caller
The |
resetAllCustomAudienceOverrides
open fun resetAllCustomAudienceOverrides(
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Removes all override data in the Custom Audience API.
This method is intended to be used for end-to-end testing. This API is enabled only for apps in debug mode with developer options enabled.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE
Parameters | |
---|---|
executor |
Executor: This value cannot be null . Callback and listener events are dispatched through this Executor , providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor() . Otherwise, provide an Executor that dispatches to an appropriate thread. |
receiver |
OutcomeReceiver<Any!, Exception!>: This value cannot be null . |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if this API is not enabled for the caller
The receiver either returns a |