Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  
Summary:[Ctors](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#pubctors)\|[Methods](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#inhmethods)  

# AdSelectionConfig.Builder

`
public
static
final

class
AdSelectionConfig.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|----------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.adservices.adselection.AdSelectionConfig.Builder |

<br />

*** ** * ** ***

Builder for[AdSelectionConfig](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig)object.

## Summary

|                                                                  ### Public constructors                                                                   ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#Builder())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                                                                           ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                           ||
|------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| ` `[AdSelectionConfig](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig)                 | ` `[build](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#build())`() ` Builds an[AdSelectionConfig](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig)instance.                                                                                                                                                                                                                                                                                                                                                                                              |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setAdSelectionSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setAdSelectionSignals(android.adservices.common.AdSelectionSignals))`(`[AdSelectionSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdSelectionSignals)` adSelectionSignals) ` Sets the signals provided to buyers during ad selection bid generation.                                                                                                                                                                                                                                           |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setCustomAudienceBuyers](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setCustomAudienceBuyers(java.util.List<android.adservices.common.AdTechIdentifier>))`(`[List](https://developer.android.com/reference/java/util/List)`<`[AdTechIdentifier](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdTechIdentifier)`> customAudienceBuyers) ` Sets the list of allowed buyers.                                                                                                                                                                                                |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setDecisionLogicUri](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setDecisionLogicUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` decisionLogicUri) ` Sets the URI used to fetch decision logic for use in the ad selection process.                                                                                                                                                                                                                                                                                                                                             |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setPerBuyerSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setPerBuyerSignals(java.util.Map<android.adservices.common.AdTechIdentifier,android.adservices.common.AdSelectionSignals>))`(`[Map](https://developer.android.com/reference/java/util/Map)`<`[AdTechIdentifier](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdTechIdentifier)`, `[AdSelectionSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdSelectionSignals)`> perBuyerSignals) ` Sets the signals provided by each buyer during ad selection. |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setSeller](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setSeller(android.adservices.common.AdTechIdentifier))`(`[AdTechIdentifier](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdTechIdentifier)` seller) ` Sets the seller identifier.                                                                                                                                                                                                                                                                                                                                 |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setSellerSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setSellerSignals(android.adservices.common.AdSelectionSignals))`(`[AdSelectionSignals](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdSelectionSignals)` sellerSignals) ` Set the signals used to modify ad selection results.                                                                                                                                                                                                                                                                             |
| ` `[AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | ` `[setTrustedScoringSignalsUri](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder#setTrustedScoringSignalsUri(android.net.Uri))`(`[Uri](https://developer.android.com/reference/android/net/Uri)` trustedScoringSignalsUri) ` Sets the URI endpoint of sell-side trusted signal from which creative specific realtime information can be fetched from.                                                                                                                                                                                                                                                                           |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public constructors

### Builder

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public Builder ()
```

<br />

<br />

## Public methods

### build

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig build ()
```

Builds an[AdSelectionConfig](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig)instance.

<br />

|                                                                                   Returns                                                                                   ||
|-----------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig) | This value cannot be`null`. <br /> |

|                                                             Throws                                                              ||
|------------------------------------------------------------------------------------------------|---------------------------------|
| [NullPointerException](https://developer.android.com/reference/java/lang/NullPointerException) | if any required params are null |

### setAdSelectionSignals

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setAdSelectionSignals (AdSelectionSignals adSelectionSignals)
```

Sets the signals provided to buyers during ad selection bid generation.

If not set, defaults to the empty JSON.

See[AdSelectionConfig.getAdSelectionSignals()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getAdSelectionSignals())for more details.

<br />

|                                   Parameters                                   ||
|----------------------|----------------------------------------------------------|
| `adSelectionSignals` | `AdSelectionSignals`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |

### setCustomAudienceBuyers

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setCustomAudienceBuyers (List<AdTechIdentifier> customAudienceBuyers)
```

Sets the list of allowed buyers.

See[AdSelectionConfig.getCustomAudienceBuyers()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getCustomAudienceBuyers())for more details.

<br />

|                             Parameters                             ||
|------------------------|--------------------------------------------|
| `customAudienceBuyers` | `List`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |

### setDecisionLogicUri

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setDecisionLogicUri (Uri decisionLogicUri)
```

Sets the URI used to fetch decision logic for use in the ad selection process. Decision URI could be either of the two schemas:

- **HTTPS:** HTTPS URIs have to be absolute URIs where the host matches the`seller`
- **Ad Selection Prebuilt:** Ad Selection Service URIs follow`ad-selection-prebuilt://ad-selection/<name>?<script-generation-parameters>`format. FLEDGE generates the appropriate JS script without the need for a network call.

  Available prebuilt scripts:
  - **`highest-bid-wins`for`scoreAds`and`reportResult`:** This JS picks the ad with the highest bid for scoring. For reporting, the given URI is parameterized with`render_uri`and`bid`. Below parameter(s) are required to use this prebuilt:
    - **`reportingUrl`:** Base reporting uri that will be parameterized later with`render_uri`and`bid`

    Ex. If your base reporting URL is "https://www.ssp.com" then,`ad-selection-prebuilt://ad-selection/highest-bid-wins/?reportingUrl=https://www.ssp.com`

See[AdSelectionConfig.getDecisionLogicUri()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getDecisionLogicUri())for more details.

<br />

|                          Parameters                           ||
|--------------------|-------------------------------------------|
| `decisionLogicUri` | `Uri`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |

### setPerBuyerSignals

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setPerBuyerSignals (Map<AdTechIdentifier, AdSelectionSignals> perBuyerSignals)
```

Sets the signals provided by each buyer during ad selection.

If not set, defaults to an empty map.

See[AdSelectionConfig.getPerBuyerSignals()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getPerBuyerSignals())for more details.

<br />

|                          Parameters                          ||
|-------------------|-------------------------------------------|
| `perBuyerSignals` | `Map`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |

### setSeller

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setSeller (AdTechIdentifier seller)
```

Sets the seller identifier.

See[AdSelectionConfig.getSeller()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getSeller())for more details.

<br />

|                            Parameters                            ||
|----------|--------------------------------------------------------|
| `seller` | `AdTechIdentifier`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |

### setSellerSignals

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setSellerSignals (AdSelectionSignals sellerSignals)
```

Set the signals used to modify ad selection results.

If not set, defaults to the empty JSON.

See[AdSelectionConfig.getSellerSignals()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getSellerSignals())for more details.

<br />

|                                Parameters                                 ||
|-----------------|----------------------------------------------------------|
| `sellerSignals` | `AdSelectionSignals`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |

### setTrustedScoringSignalsUri

Added in[API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in[Ad Services Extensions 4](https://developer.android.com/sdkExtensions)  

```
public AdSelectionConfig.Builder setTrustedScoringSignalsUri (Uri trustedScoringSignalsUri)
```

Sets the URI endpoint of sell-side trusted signal from which creative specific realtime information can be fetched from.

If[Uri#EMPTY](https://developer.android.com/reference/android/net/Uri#EMPTY)is passed then network call will be skipped and[AdSelectionSignals.EMPTY](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/common/AdSelectionSignals#EMPTY)will be passed to ad selection.

See[AdSelectionConfig.getTrustedScoringSignalsUri()](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig#getTrustedScoringSignalsUri())for more details.

<br />

|                              Parameters                               ||
|----------------------------|-------------------------------------------|
| `trustedScoringSignalsUri` | `Uri`: This value cannot be`null`. <br /> |

|                                                                                           Returns                                                                                           ||
|---------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------|
| [AdSelectionConfig.Builder](https://developer.android.com/design-for-safety/privacy-sandbox/reference/adservices/adselection/AdSelectionConfig.Builder) | This value cannot be`null`. <br /> |