ExecuteInIsolatedServiceRequest.OutputSpec


public static class ExecuteInIsolatedServiceRequest.OutputSpec
extends Object

java.lang.Object
   ↳ android.adservices.ondevicepersonalization.ExecuteInIsolatedServiceRequest.OutputSpec


The set of spec to indicate output of IsolatedService. It's mainly used by platform. If OutputSpec is set to OutputSpec.DEFAULT, OnDevicePersonalization will ignore result returned by IsolatedService. If OutputSpec is built with buildBestValueSpec(int), OnDevicePersonalization will verify ExecuteOutput.getBestValue() returned by IsolatedService within the max value range set in OutputSpec.getMaxIntValue and add noise.

Summary

Constants

int OUTPUT_TYPE_BEST_VALUE

If set, ExecuteInIsolatedServiceResponse.getBestValue() will return an integer that indicates the index of best values passed in ExecuteInIsolatedServiceRequest.getAppParams().

int OUTPUT_TYPE_NULL

The default value of OutputType.

Fields

public static final ExecuteInIsolatedServiceRequest.OutputSpec DEFAULT

The default value of OutputSpec.

Public methods

static ExecuteInIsolatedServiceRequest.OutputSpec buildBestValueSpec(int maxIntValue)

Creates the output spec to get best value out of maxIntValue.

int getMaxIntValue()

Returns the value set in OutputSpec.buildBestValueSpec.

int getOutputType()

Returns the output type of IsolatedService.

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.

Constants

OUTPUT_TYPE_BEST_VALUE

public static final int OUTPUT_TYPE_BEST_VALUE

If set, ExecuteInIsolatedServiceResponse.getBestValue() will return an integer that indicates the index of best values passed in ExecuteInIsolatedServiceRequest.getAppParams().

Constant Value: 1 (0x00000001)

OUTPUT_TYPE_NULL

public static final int OUTPUT_TYPE_NULL

The default value of OutputType. If set, OnDevicePersonalization will ignore result returned by IsolatedService and ExecuteInIsolatedServiceResponse doesn't return any output data.

Constant Value: 0 (0x00000000)

Fields

DEFAULT

public static final ExecuteInIsolatedServiceRequest.OutputSpec DEFAULT

The default value of OutputSpec.

Public methods

buildBestValueSpec

public static ExecuteInIsolatedServiceRequest.OutputSpec buildBestValueSpec (int maxIntValue)

Creates the output spec to get best value out of maxIntValue. If set this, caller can call ExecuteInIsolatedServiceResponse.getBestValue to get result.

Parameters
maxIntValue int: the maximum value IsolatedWorker can return to caller app. Value is 0 or greater

Returns
ExecuteInIsolatedServiceRequest.OutputSpec This value cannot be null.

getMaxIntValue

public int getMaxIntValue ()

Returns the value set in OutputSpec.buildBestValueSpec. The value is expected to be ExecuteInIsolatedServiceResponse.DEFAULT_BEST_VALUE if getOutputType() is OutputSpec.OUTPUT_TYPE_NULL.

Returns
int Value is DEFAULT_BEST_VALUE or greater

getOutputType

public int getOutputType ()

Returns the output type of IsolatedService. The default value is OUTPUT_TYPE_NULL.

Returns
int Value is OUTPUT_TYPE_NULL, or OUTPUT_TYPE_BEST_VALUE