TestAdSelectionManager
open classTestAdSelectionManager
| kotlin.Any | |
| ↳ | android.adservices.adselection.TestAdSelectionManager |
TestAdSelectionManager provides APIs for apps and ad SDKs to test ad selection processes.
These APIs are intended to be used for end-to-end testing. They are enabled only for debuggable apps on phones running a debuggable OS build with developer options enabled.
Summary
Public methods
overrideAdSelectionConfigRemoteInfo
open funoverrideAdSelectionConfigRemoteInfo(
request: AddAdSelectionOverrideRequest,
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Deprecated: Deprecated in Java.
Overrides the AdSelection API for a given AdSelectionConfig to avoid fetching data from remote servers and use the data provided in AddAdSelectionOverrideRequest instead. The AddAdSelectionOverrideRequest 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.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_PROTECTED_SIGNALS or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_SELECTION
| Parameters | |
|---|---|
request |
AddAdSelectionOverrideRequest: 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 |
overrideAdSelectionFromOutcomesConfigRemoteInfo
open funoverrideAdSelectionFromOutcomesConfigRemoteInfo(
request: AddAdSelectionFromOutcomesOverrideRequest,
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Deprecated: Deprecated in Java.
Overrides the AdSelection API for AdSelectionFromOutcomesConfig to avoid fetching data from remote servers and use the data provided in AddAdSelectionFromOutcomesOverrideRequest instead. The AddAdSelectionFromOutcomesOverrideRequest 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.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_PROTECTED_SIGNALS or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_SELECTION
| Parameters | |
|---|---|
request |
AddAdSelectionFromOutcomesOverrideRequest: 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 |
removeAdSelectionConfigRemoteInfoOverride
open funremoveAdSelectionConfigRemoteInfoOverride(
request: RemoveAdSelectionOverrideRequest,
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Deprecated: Deprecated in Java.
Removes an override for AdSelectionConfig in the Ad Selection API with associated the data in RemoveAdSelectionOverrideRequest. The RemoveAdSelectionOverrideRequest 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.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_PROTECTED_SIGNALS or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_SELECTION
| Parameters | |
|---|---|
request |
RemoveAdSelectionOverrideRequest: 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 |
removeAdSelectionFromOutcomesConfigRemoteInfoOverride
open funremoveAdSelectionFromOutcomesConfigRemoteInfoOverride(
request: RemoveAdSelectionFromOutcomesOverrideRequest,
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Deprecated: Deprecated in Java.
Removes an override for AdSelectionFromOutcomesConfig in th Ad Selection API with associated the data in RemoveAdSelectionOverrideRequest. The RemoveAdSelectionOverrideRequest 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.
Requires android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_CUSTOM_AUDIENCE or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_PROTECTED_SIGNALS or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_SELECTION
| Parameters | |
|---|---|
request |
RemoveAdSelectionFromOutcomesOverrideRequest: 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 |
resetAllAdSelectionConfigRemoteOverrides
open funresetAllAdSelectionConfigRemoteOverrides(
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Deprecated: Deprecated in Java.
Removes all override data for AdSelectionConfig in the Ad Selection 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 or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_PROTECTED_SIGNALS or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_SELECTION
| 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 |
resetAllAdSelectionFromOutcomesConfigRemoteOverrides
open funresetAllAdSelectionFromOutcomesConfigRemoteOverrides(
executor: Executor,
receiver: OutcomeReceiver<Any!, Exception!>
): Unit
Deprecated: Deprecated in Java.
Removes all override data for AdSelectionFromOutcomesConfig in the Ad Selection 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 or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_PROTECTED_SIGNALS or android.adservices.common.AdServicesPermissions#ACCESS_ADSERVICES_AD_SELECTION
| 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 |