Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Also in [Ad Services Extensions 8](https://developer.android.com/sdkExtensions)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#nestedclasses) \| [Methods](https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#inhmethods)

# UpdateAdCounterHistogramRequest

*** ** * ** ***


`
public


class
UpdateAdCounterHistogramRequest
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***


**This class was deprecated
in API level 37.**   

The Rubidium (Rb) Relevance APIs, including those in android.adservices.adselection,
are being deprecated. Relevance APIs have no direct replacement. Developers should stop using
them, as calls will be rejected in future Android releases. Please refer to official Privacy
Sandbox documentation for deprecation and roadmap details:
https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/

Request object wrapping the required arguments needed to update an ad counter histogram.

The ad counter histograms, which are historical logs of events which are associated with an ad
counter key and an ad event type, are used to inform frequency cap filtering when using the
Protected Audience APIs.

## Summary

| ### Nested classes ||
|---|---|
| ` class` | `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest.Builder` *This class was deprecated in API level 37. The Rubidium (Rb) Relevance APIs, including those in android.adservices.adselection, are being deprecated. Relevance APIs have no direct replacement. Developers should stop using them, as calls will be rejected in future Android releases. Please refer to official Privacy Sandbox documentation for deprecation and roadmap details: https://privacysandbox.com/news/update-on-plans-for-privacy-sandbox-technologies/* |

| ### Public methods ||
|---|---|
| ` boolean` | ` https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Checks whether the `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest` objects contain the same information. |
| ` int` | ` https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#getAdEventType()() ` Gets the ad event type which, along with an ad's counter keys, identifies which histogram should be updated. |
| ` long` | ` https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#getAdSelectionId()() ` Gets the ad selection ID with which the rendered ad's events are associated. |
| ` https://developer.android.com/reference/android/adservices/common/AdTechIdentifier` | ` https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#getCallerAdTech()() ` Gets the caller adtech entity's `https://developer.android.com/reference/android/adservices/common/AdTechIdentifier`. |
| ` int` | ` https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#hashCode()() ` Returns the hash of the `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest` object's data. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#toString()() ` Returns a string representation of the object. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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 methods

### equals

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object o)
```

Checks whether the `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest` objects contain the same
information.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getAdEventType

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

```
public int getAdEventType ()
```

Gets the ad event type which, along with an ad's counter keys, identifies which histogram
should be updated.

<br />

| Returns ||
|---|---|
| `int` | Value is one of the following: - `https://developer.android.com/reference/android/adservices/common/FrequencyCapFilters#AD_EVENT_TYPE_WIN` - `https://developer.android.com/reference/android/adservices/common/FrequencyCapFilters#AD_EVENT_TYPE_IMPRESSION` - `https://developer.android.com/reference/android/adservices/common/FrequencyCapFilters#AD_EVENT_TYPE_VIEW` - `https://developer.android.com/reference/android/adservices/common/FrequencyCapFilters#AD_EVENT_TYPE_CLICK` |

### getAdSelectionId

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

```
public long getAdSelectionId ()
```

Gets the ad selection ID with which the rendered ad's events are associated.

For more information about the ad selection ID, see `https://developer.android.com/reference/android/adservices/adselection/AdSelectionOutcome`.

The ad must have been selected from Protected Audience ad selection in the last 24 hours,
and the ad selection call must have been initiated from the same app as the current calling
app. Event histograms for all ad counter keys associated with the ad specified by the ad
selection ID will be updated for the ad event type from `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#getAdEventType()`, to be used
in Protected Audience frequency cap filtering.

<br />

| Returns ||
|---|---|
| `long` | <br /> |

### getCallerAdTech

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

```
public AdTechIdentifier getCallerAdTech ()
```

Gets the caller adtech entity's `https://developer.android.com/reference/android/adservices/common/AdTechIdentifier`.

The adtech using this `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest` object must have enrolled
with the Privacy Sandbox and be allowed to act on behalf of the calling app. The specified
adtech is not required to be the same adtech as either the buyer which owns the rendered ad
or the seller which initiated the ad selection associated with the ID returned by `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest#getAdSelectionId()`.

For more information about API requirements and exceptions, see `https://developer.android.com/reference/android/adservices/adselection/AdSelectionManager#updateAdCounterHistogram(android.adservices.adselection.UpdateAdCounterHistogramRequest,%20java.util.concurrent.Executor,%20android.os.OutcomeReceiver<java.lang.Object,java.lang.Exception>)`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/adservices/common/AdTechIdentifier` | This value cannot be `null`. <br /> |

### hashCode

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns the hash of the `https://developer.android.com/reference/android/adservices/adselection/UpdateAdCounterHistogramRequest` object's data.

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level
37](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |