ExecuteOutput.Builder


public static final class ExecuteOutput.Builder
extends Object

java.lang.Object
   ↳ android.adservices.ondevicepersonalization.ExecuteOutput.Builder


A builder for ExecuteOutput

Summary

Public constructors

Builder()

Public methods

ExecuteOutput.Builder addEventLogRecord(EventLogRecord value)
ExecuteOutput build()

Builds the instance.

ExecuteOutput.Builder setBestValue(int value)

An integer value that an IsolatedService may optionally return to a calling app, by setting this field to the value between 0 and ExecuteInIsolatedServiceRequest.OutputSpec.getMaxIntValue().

ExecuteOutput.Builder setEventLogRecords(List<EventLogRecord> value)

A list of EventLogRecord objects to be written to the EVENTS table.

ExecuteOutput.Builder setOutputData(byte... value)

A byte array that an IsolatedService may optionally return to a calling app, by setting this field to a non-null value.

ExecuteOutput.Builder setRenderingConfig(RenderingConfig value)

A RenderingConfig object that contains information about the content to be rendered in the client app view.

ExecuteOutput.Builder setRequestLogRecord(RequestLogRecord value)

Persistent data to be written to the REQUESTS table after IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver) completes.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(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(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()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Builder

Added in API level 35
public Builder ()

Public methods

addEventLogRecord

Added in API level 35
public ExecuteOutput.Builder addEventLogRecord (EventLogRecord value)

Parameters
value EventLogRecord: This value cannot be null.

Returns
ExecuteOutput.Builder This value cannot be null.

build

Added in API level 35
public ExecuteOutput build ()

Builds the instance. This builder should not be touched after calling this!

Returns
ExecuteOutput This value cannot be null.

setBestValue

public ExecuteOutput.Builder setBestValue (int value)

An integer value that an IsolatedService may optionally return to a calling app, by setting this field to the value between 0 and ExecuteInIsolatedServiceRequest.OutputSpec.getMaxIntValue(). The noise will be added to the value of this field before returned to the caller of OnDevicePersonalizationManager.executeInIsolatedService(ExecuteInIsolatedServiceRequest, Executor, OutcomeReceiver). In order to get this field, the (calling app package, isolated service package) pair must be present in an allowlist that permits data to be returned and ExecuteInIsolatedServiceRequest.OutputSpec.buildBestValueSpec(int) is set.

Parameters
value int: Value is 0 or greater

Returns
ExecuteOutput.Builder This value cannot be null.

setEventLogRecords

Added in API level 35
public ExecuteOutput.Builder setEventLogRecords (List<EventLogRecord> value)

A list of EventLogRecord objects to be written to the EVENTS table. Each EventLogRecord must be associated with an existing RequestLogRecord in the REQUESTS table, specified using EventLogRecord.Builder.setRequestLogRecord(RequestLogRecord). If the RequestLogRecord is not specified, the EventLogRecord will not be written.

Parameters
value List: This value cannot be null.

Returns
ExecuteOutput.Builder This value cannot be null.

setOutputData

Added in API level 35
public ExecuteOutput.Builder setOutputData (byte... value)

A byte array that an IsolatedService may optionally return to a calling app, by setting this field to a non-null value. The contents of this array will be returned to the caller of OnDevicePersonalizationManager.execute(ComponentName, PersistableBundle, java.util.concurrent.Executor, OutcomeReceiver) if returning data from isolated processes is allowed by policy and the (calling app package, isolated service package) pair is present in an allowlist that permits data to be returned.

Parameters
value byte: This value may be null.

setRenderingConfig

Added in API level 35
public ExecuteOutput.Builder setRenderingConfig (RenderingConfig value)

A RenderingConfig object that contains information about the content to be rendered in the client app view. Can be null if no content is to be rendered.

Parameters
value RenderingConfig: This value may be null.

setRequestLogRecord

Added in API level 35
public ExecuteOutput.Builder setRequestLogRecord (RequestLogRecord value)

Persistent data to be written to the REQUESTS table after IsolatedWorker.onExecute(ExecuteInput, android.os.OutcomeReceiver) completes. If null, no persistent data will be written.

Parameters
value RequestLogRecord: This value may be null.