TestAdSelectionManager
  public
  
  
  
  class
  TestAdSelectionManager
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.adservices.adselection.TestAdSelectionManager | 
TestAdSelectionManager 為應用程式和廣告 SDK 提供 API,用於測試廣告選擇程序。
 
這些 API 適用於端對端測試。只有 執行可偵錯的 OS 版本且已啟用開發人員選項的手機上,可進行偵錯的應用程式。
摘要
繼承方法 | |
|---|---|
公用方法
覆寫 AdSelectionConfigRemoteInfo
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
      接收器會在成功執行後傳回   | 
        
覆寫 AdSelectionFromResultsConfigRemoteInfo
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
      接收器會在成功執行後傳回   |