SignedContextualAds


class SignedContextualAds : Parcelable
kotlin.Any
   ↳ android.adservices.adselection.SignedContextualAds

Contains a list of buyer supplied AdWithBid bundle and its signature.

Instances of this class are created by SDKs to be injected as part of AdSelectionConfig and passed to android.adservices.adselection.AdSelectionManager#selectAds

SignedContextualAds are signed using ECDSA algorithm with SHA256 hashing algorithm (aka SHA256withECDSA). Keys used should belong to P-256 curve (aka “secp256r1” or “prime256v1”).

Signature should include the buyer, decisionLogicUri and adsWithBid fields.

While creating the signature a specific serialization rules must be followed as it's outlined here:

  • Objects concatenate the serialized values of their fields with the | (pipe) in between each field
  • All fields are sorted by alphabetical order within the object
  • Nullable fields are skipped if they are null/unset
  • Doubles are converted to String preserving precision
  • Integers are converted to string values
  • Sets are sorted alphabetically
  • Lists keep the same order
  • Strings get encoded into byte[] using UTF-8 encoding

Summary

Nested classes

Builder for SignedContextualAds object

Inherited constants
Public methods
Int

Boolean
equals(other: Any?)

MutableList<AdWithBid!>

AdTechIdentifier

Uri

ByteArray

Returns a copy of the signature for the contextual ads object.

Int

String

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<SignedContextualAds!>

Public methods

describeContents

Added in API level 35
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 35
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAdsWithBid

fun getAdsWithBid(): MutableList<AdWithBid!>
Return
MutableList<AdWithBid!> the Ad data with bid value associated with this ad This value cannot be null.

getBuyer

fun getBuyer(): AdTechIdentifier
Return
AdTechIdentifier the Ad tech identifier from which this contextual Ad would have been downloaded This value cannot be null.

getDecisionLogicUri

fun getDecisionLogicUri(): Uri
Return
Uri the URI used to retrieve the updateBid() and reportWin() function used during the ad selection and reporting process This value cannot be null.

getSignature

fun getSignature(): ByteArray

Returns a copy of the signature for the contextual ads object.

See SignedContextualAds for more details.

Return
ByteArray the signature This value cannot be null.

hashCode

Added in API level 35
fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 35
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 35
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

static val CREATOR: Parcelable.Creator<SignedContextualAds!>