TestAdSelectionManager
  public
  
  
  
  class
  TestAdSelectionManager
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.adservices.adselection.TestAdSelectionManager | 
TestAdSelectionManager 为应用和广告 SDK 提供用于测试广告选择流程的 API。
 
这些 API 旨在用于端到端测试。只有 搭载可调试 OS build 且启用了开发者选项的手机上的可调试应用。
摘要
继承的方法 | |
|---|---|
公共方法
OverrideAdSelectionConfigRemoteInfo
public void overrideAdSelectionConfigRemoteInfo (AddAdSelectionOverrideRequest request, Executor executor, OutcomeReceiver<Object, Exception> receiver)
替换给定 AdSelectionConfig 的 AdSelection API,以避免提取数据
 并使用 AddAdSelectionOverrideRequest 中提供的数据
 。AddAdSelectionOverrideRequest 由广告 SDK 提供。
 
此方法旨在用于端到端测试。此 API 仅对
 启用开发者选项的调试模式应用。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE
| 参数 | |
|---|---|
request | 
        
          AddAdSelectionOverrideRequest:此值不能为 null。 | 
      
executor | 
        
          Executor:此值不能为 null。
 
 回调和监听器事件通过此
 Executor,可让您轻松控制要
 。要通过
 可以使用
 Context.getMainExecutor()。
 否则,请提供分派给相应线程的 Executor。 | 
      
receiver | 
        
          OutcomeReceiver:此值不能为 null。 | 
      
| 抛出 | |
|---|---|
IllegalStateException | 
          如果没有为调用方启用此 API
      接收器会返回   | 
        
覆盖 AdSelectionFromOutcomesConfigRemoteInfo
public void overrideAdSelectionFromOutcomesConfigRemoteInfo (AddAdSelectionFromOutcomesOverrideRequest request, Executor executor, OutcomeReceiver<Object, Exception> receiver)
替换 AdSelectionFromOutcomesConfig 的 AdSelection API,以避免提取
 并改用 AddAdSelectionFromOutcomesOverrideRequest 中提供的数据。AddAdSelectionFromOutcomesOverrideRequest 由广告 SDK 提供。
 
此方法旨在用于端到端测试。此 API 仅对
 启用开发者选项的调试模式应用。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE
| 参数 | |
|---|---|
request | 
        
          AddAdSelectionFromOutcomesOverrideRequest:此值不能为 null。 | 
      
executor | 
        
          Executor:此值不能为 null。
 
 回调和监听器事件通过此
 Executor,可让您轻松控制要
 。要通过
 可以使用
 Context.getMainExecutor()。
 否则,请提供分派给相应线程的 Executor。 | 
      
receiver | 
        
          OutcomeReceiver:此值不能为 null。 | 
      
| 抛出 | |
|---|---|
IllegalStateException | 
          如果没有为调用方启用此 API
      接收器会返回   | 
        
removeAdSelectionConfigRemoteInfoOverride
public void removeAdSelectionConfigRemoteInfoOverride (RemoveAdSelectionOverrideRequest request, Executor executor, OutcomeReceiver<Object, Exception> receiver)
删除 Ad Selection API 中的 AdSelectionConfig 与
 RemoveAdSelectionOverrideRequest 中的数据。RemoveAdSelectionOverrideRequest 由广告 SDK 提供。
 
此方法旨在用于端到端测试。此 API 仅对
 启用开发者选项的调试模式应用。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE
| 参数 | |
|---|---|
request | 
        
          RemoveAdSelectionOverrideRequest:此值不能为 null。 | 
      
executor | 
        
          Executor:此值不能为 null。
 
 回调和监听器事件通过此
 Executor,可让您轻松控制要
 。要通过
 可以使用
 Context.getMainExecutor()。
 否则,请提供分派给相应线程的 Executor。 | 
      
receiver | 
        
          OutcomeReceiver:此值不能为 null。 | 
      
| 抛出 | |
|---|---|
IllegalStateException | 
          如果没有为调用方启用此 API
      接收器会返回   | 
        
removeAdSelectionFromOutcomesConfigRemoteInfoOverride
public void removeAdSelectionFromOutcomesConfigRemoteInfoOverride (RemoveAdSelectionFromOutcomesOverrideRequest request, Executor executor, OutcomeReceiver<Object, Exception> receiver)
从 Ad Selection API 移除 AdSelectionFromOutcomesConfig 的替换项,值为
 关联了 RemoveAdSelectionOverrideRequest 中的数据。RemoveAdSelectionOverrideRequest 由广告 SDK 提供。
 
此方法旨在用于端到端测试。此 API 仅对
 启用开发者选项的调试模式应用。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE
| 参数 | |
|---|---|
request | 
        
          RemoveAdSelectionFromOutcomesOverrideRequest:此值不能为 null。 | 
      
executor | 
        
          Executor:此值不能为 null。
 
 回调和监听器事件通过此
 Executor,可让您轻松控制要
 。要通过
 可以使用
 Context.getMainExecutor()。
 否则,请提供分派给相应线程的 Executor。 | 
      
receiver | 
        
          OutcomeReceiver:此值不能为 null。 | 
      
| 抛出 | |
|---|---|
IllegalStateException | 
          如果没有为调用方启用此 API
      接收器会返回   | 
        
resetAllAdSelectionConfigRemoteOverrides
public void resetAllAdSelectionConfigRemoteOverrides (Executor executor, OutcomeReceiver<Object, Exception> receiver)
移除 Ad Selection API 中 AdSelectionConfig 的所有替换数据。
 
此方法旨在用于端到端测试。此 API 仅对
 启用开发者选项的调试模式应用。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE
| 参数 | |
|---|---|
executor | 
        
          Executor:此值不能为 null。
 
 回调和监听器事件通过此
 Executor,可让您轻松控制要
 。要通过
 可以使用
 Context.getMainExecutor()。
 否则,请提供分派给相应线程的 Executor。 | 
      
receiver | 
        
          OutcomeReceiver:此值不能为 null。 | 
      
| 抛出 | |
|---|---|
IllegalStateException | 
          如果没有为调用方启用此 API
      接收器会返回   | 
        
resetAllAdSelectionFromOutcomesConfigRemoteOverrides
public void resetAllAdSelectionFromOutcomesConfigRemoteOverrides (Executor executor, OutcomeReceiver<Object, Exception> receiver)
移除 Ad Selection API 中 AdSelectionFromOutcomesConfig 的所有替换数据。
 
此方法旨在用于端到端测试。此 API 仅对
 启用开发者选项的调试模式应用。
 
 需要 AdServicesPermissions.ACCESS_ADSERVICES_CUSTOM_AUDIENCE
| 参数 | |
|---|---|
executor | 
        
          Executor:此值不能为 null。
 
 回调和监听器事件通过此
 Executor,可让您轻松控制要
 。要通过
 可以使用
 Context.getMainExecutor()。
 否则,请提供分派给相应线程的 Executor。 | 
      
receiver | 
        
          OutcomeReceiver:此值不能为 null。 | 
      
| 抛出 | |
|---|---|
IllegalStateException | 
          如果没有为调用方启用此 API
      接收器会返回   |