Added in API level 36

ExecuteAppFunctionResponse


class ExecuteAppFunctionResponse : Parcelable
kotlin.Any
   ↳ android.app.appfunctions.ExecuteAppFunctionResponse

The response to an app function execution, returned by AppFunctionManager.executeAppFunction.

Use AppFunctionMetadata to determine the expected structure of the response.

Summary

Constants
static String

The name of the property that stores the function return value within the getResultDocument.

Inherited constants
Public constructors

Constructs an ExecuteAppFunctionResponse.

Constructs an ExecuteAppFunctionResponse with an additional Bundle.

Constructs an ExecuteAppFunctionResponse with an additional Bundle and AppFunctionUriGrants.

Public methods
Int

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

Bundle

Returns the additional metadata for this function execution response.

GenericDocument

Returns a GenericDocument containing the return value of the executed function.

MutableList<AppFunctionUriGrant!>

The list of AppFunctionUriGrant to which the caller of this app function execution should have temporary access granted.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<ExecuteAppFunctionResponse!>

Constants

PROPERTY_RETURN_VALUE

Added in API level 36
static val PROPERTY_RETURN_VALUE: String

The name of the property that stores the function return value within the getResultDocument.

If the function returns void or throws an error, this property will not be set.

Value: "androidAppfunctionsReturnValue"

Public constructors

ExecuteAppFunctionResponse

Added in API level 36
ExecuteAppFunctionResponse(resultDocument: GenericDocument)

Constructs an ExecuteAppFunctionResponse.

Parameters
resultDocument GenericDocument: The return value of the executed function, see getResultDocument.
This value cannot be null.

ExecuteAppFunctionResponse

Added in API level 36
ExecuteAppFunctionResponse(
    resultDocument: GenericDocument,
    extras: Bundle)

Constructs an ExecuteAppFunctionResponse with an additional Bundle.

Parameters
resultDocument GenericDocument: The return value of the executed function, see getResultDocument.
This value cannot be null.
extras Bundle: The additional metadata for this function execution response, see getExtras.
This value cannot be null.

ExecuteAppFunctionResponse

Added in API level 37
ExecuteAppFunctionResponse(
    resultDocument: GenericDocument,
    extras: Bundle,
    uriGrants: MutableList<AppFunctionUriGrant!>)

Constructs an ExecuteAppFunctionResponse with an additional Bundle and AppFunctionUriGrants.

Parameters
resultDocument GenericDocument: The return value of the executed function, see getResultDocument.
This value cannot be null.
extras Bundle: The additional metadata for this function execution response, see getExtras.
This value cannot be null.
uriGrants MutableList<AppFunctionUriGrant!>: The list of AppFunctionUriGrant to which the caller of this app function execution should have temporary access granted.
This value cannot be null.

Public methods

describeContents

Added in API level 36
fun describeContents(): Int

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(Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

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

getExtras

Added in API level 36
fun getExtras(): Bundle

Returns the additional metadata for this function execution response.

Return
Bundle This value cannot be null.

getResultDocument

Added in API level 36
fun getResultDocument(): GenericDocument

Returns a GenericDocument containing the return value of the executed function.

The PROPERTY_RETURN_VALUE key can be used to obtain the return value.

Example of extracting the return value:

<code>GenericDocument resultDocument = response.getResultDocument();
  Object returnValue = resultDocument.getProperty(PROPERTY_RETURN_VALUE);
  if (returnValue != null) {
    // Cast returnValue to expected type, or use GenericDocument#getPropertyString,
    // GenericDocument#getPropertyLong, etc.
  }
  </code>

Use AppFunctionMetadata to determine the expected structure of this document.

getUriGrants

Added in API level 37
fun getUriGrants(): MutableList<AppFunctionUriGrant!>

The list of AppFunctionUriGrant to which the caller of this app function execution should have temporary access granted.

Return
MutableList<AppFunctionUriGrant!> This value cannot be null.

writeToParcel

Added in API level 36
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 the following:

Properties

CREATOR

Added in API level 36
static val CREATOR: Parcelable.Creator<ExecuteAppFunctionResponse!>