UpdateAdCounterHistogramRequest


public class UpdateAdCounterHistogramRequest
extends Object

java.lang.Object
   ↳ android.adservices.adselection.UpdateAdCounterHistogramRequest


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 UpdateAdCounterHistogramRequest.Builder

Builder for UpdateAdCounterHistogramRequest objects. 

Public methods

boolean equals(Object o)

Checks whether the UpdateAdCounterHistogramRequest objects contain the same information.

int getAdEventType()

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

long getAdSelectionId()

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

AdTechIdentifier getCallerAdTech()

Gets the caller adtech entity's AdTechIdentifier.

int hashCode()

Returns the hash of the UpdateAdCounterHistogramRequest object's data.

String toString()

Returns a string representation of the object.

Inherited methods

Public methods

equals

Added in API level 35
public boolean equals (Object o)

Checks whether the UpdateAdCounterHistogramRequest objects contain the same information.

Parameters
o Object: the reference object with which to compare.

Returns
boolean true if this object is the same as the obj argument; false otherwise.

getAdEventType

public int getAdEventType ()

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

Returns
int Value is android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_INVALID, FrequencyCapFilters.AD_EVENT_TYPE_WIN, FrequencyCapFilters.AD_EVENT_TYPE_IMPRESSION, FrequencyCapFilters.AD_EVENT_TYPE_VIEW, FrequencyCapFilters.AD_EVENT_TYPE_CLICK, android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_MIN, or android.adservices.common.FrequencyCapFilters.AD_EVENT_TYPE_MAX

getAdSelectionId

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 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 getAdEventType(), to be used in Protected Audience frequency cap filtering.

Returns
long

getCallerAdTech

public AdTechIdentifier getCallerAdTech ()

Gets the caller adtech entity's AdTechIdentifier.

The adtech using this 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 getAdSelectionId().

For more information about API requirements and exceptions, see AdSelectionManager.updateAdCounterHistogram(android.adservices.adselection.UpdateAdCounterHistogramRequest, java.util.concurrent.Executor, android.os.OutcomeReceiver).

Returns
AdTechIdentifier This value cannot be null.

hashCode

Added in API level 35
public int hashCode ()

Returns the hash of the UpdateAdCounterHistogramRequest object's data.

Returns
int a hash code value for this object.

toString

Added in API level 35
public String toString ()

Returns a string representation of the object.

Returns
String a string representation of the object.