ExecuteAppFunctionRequest


public final class ExecuteAppFunctionRequest
extends Object implements Parcelable

java.lang.Object
   ↳ android.app.appfunctions.ExecuteAppFunctionRequest


A request to execute an app function.

The ExecuteAppFunctionRequest.getParameters() contains the parameters for the function to be executed in a GenericDocument. Structured classes defined in the AppFunction SDK can be converted into GenericDocuments.

The ExecuteAppFunctionRequest.getExtras() provides any extra metadata for the request. Structured APIs can be exposed in the SDK by packing and unpacking this Bundle.

Summary

Nested classes

class ExecuteAppFunctionRequest.Builder

Builder for ExecuteAppFunctionRequest

Inherited constants

int CONTENTS_FILE_DESCRIPTOR

Descriptor bit used with describeContents(): indicates that the Parcelable object's flattened representation includes a file descriptor.

int PARCELABLE_WRITE_RETURN_VALUE

Flag for use with writeToParcel(Parcel, int): the object being written is a return value, that is the result of a function such as "Parcelable someFunction()", "void someFunction(out Parcelable)", or "void someFunction(inout Parcelable)".

Fields

public static final Creator<ExecuteAppFunctionRequest> CREATOR

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Bundle getExtras()

Returns the additional metadata for this function execution request.

String getFunctionIdentifier()

Returns the unique string identifier of the app function to be executed.

GenericDocument getParameters()

Returns the function parameters.

String getTargetPackageName()

Returns the package name of the app that hosts the function.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

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.

abstract int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

abstract void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Fields

CREATOR

public static final Creator<ExecuteAppFunctionRequest> CREATOR

Public methods

describeContents

public int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

getExtras

public Bundle getExtras ()

Returns the additional metadata for this function execution request.

Returns
Bundle This value cannot be null.

getFunctionIdentifier

public String getFunctionIdentifier ()

Returns the unique string identifier of the app function to be executed.

When there is a package change or the device starts up, the metadata of available functions is indexed by AppSearch. AppSearch stores the indexed information as AppFunctionStaticMetadata document.

The ID can be obtained by querying the AppFunctionStaticMetadata documents from AppSearch.

If the functionId provided is invalid, the caller will get an invalid argument response.

Returns
String This value cannot be null.

getParameters

public GenericDocument getParameters ()

Returns the function parameters. The key is the parameter name, and the value is the parameter value.

The GenericDocument may have missing parameters. Developers are advised to implement defensive handling measures.

Returns
GenericDocument This value cannot be null.

getTargetPackageName

public String getTargetPackageName ()

Returns the package name of the app that hosts the function.

Returns
String This value cannot be null.

writeToParcel

public void writeToParcel (Parcel dest, 
                int flags)

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.PARCELABLE_WRITE_RETURN_VALUE. Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES