Stay organized with collections Save and categorize content based on your preferences.

TestCustomAudienceManager

public class TestCustomAudienceManager
extends Object

java.lang.Object
   ↳ android.adservices.customaudience.TestCustomAudienceManager


TestCustomAudienceManager provides APIs for app and ad-SDKs to test custom audiences.

Summary

Public methods

void overrideCustomAudienceRemoteInfo(AddCustomAudienceOverrideRequest request, Executor executor, OutcomeReceiver<ObjectException> receiver)

Overrides the Custom Audience API to avoid fetching data from remote servers and use the data provided in AddCustomAudienceOverrideRequest instead.

void removeCustomAudienceRemoteInfoOverride(RemoveCustomAudienceOverrideRequest request, Executor executor, OutcomeReceiver<ObjectException> receiver)

Removes an override in th Custom Audience API with associated the data in RemoveCustomAudienceOverrideRequest.

void resetAllCustomAudienceOverrides(Executor executor, OutcomeReceiver<ObjectException> receiver)

Removes all override data in the Custom Audience API.

Inherited methods

Public methods

overrideCustomAudienceRemoteInfo

public void overrideCustomAudienceRemoteInfo (AddCustomAudienceOverrideRequest request, 
                Executor executor, 
                OutcomeReceiver<ObjectException> receiver)

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.

Parameters
request AddCustomAudienceOverrideRequest: This value cannot be null.

executor Executor: This value cannot be null.
receiver OutcomeReceiver: This value cannot be null.

Throws
IllegalStateException if this API is not enabled for the caller

The receiver either returns a void for a successful run, or an Exception indicates the error.

removeCustomAudienceRemoteInfoOverride

public void removeCustomAudienceRemoteInfoOverride (RemoveCustomAudienceOverrideRequest request, 
                Executor executor, 
                OutcomeReceiver<ObjectException> receiver)

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.

Parameters
request RemoveCustomAudienceOverrideRequest: This value cannot be null.

executor Executor: This value cannot be null.
receiver OutcomeReceiver: This value cannot be null.

Throws
IllegalStateException if this API is not enabled for the caller

The RemoveCustomAudienceOverrideRequest is provided by the Ads SDK. The receiver either returns a void for a successful run, or an Exception indicates the error.

resetAllCustomAudienceOverrides

public void resetAllCustomAudienceOverrides (Executor executor, 
                OutcomeReceiver<ObjectException> receiver)

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.

Parameters
executor Executor: This value cannot be null.
receiver OutcomeReceiver: This value cannot be null.

Throws
IllegalStateException if this API is not enabled for the caller

The receiver either returns a void for a successful run, or an Exception indicates the error.