Added in API level 36

Builder


class Builder
kotlin.Any
   ↳ android.app.appfunctions.ExecuteAppFunctionRequest.Builder

Builder for ExecuteAppFunctionRequest.

Summary

Public constructors
Builder(appFunctionName: AppFunctionName)

Constructs a ExecuteAppFunctionRequest.Builder.

Builder(targetPackageName: String, functionIdentifier: String)

Constructs a ExecuteAppFunctionRequest.Builder.

Public methods
ExecuteAppFunctionRequest

Builds the ExecuteAppFunctionRequest.

ExecuteAppFunctionRequest.Builder

Sets the AppFunctionActivityId.

ExecuteAppFunctionRequest.Builder

Sets the AppInteractionAttribution.

ExecuteAppFunctionRequest.Builder
setExtras(extras: Bundle)

Sets the additional metadata for this function execution request.

ExecuteAppFunctionRequest.Builder

Sets the function parameters as a key-value GenericDocument.

Public constructors

Builder

Added in API level 37
Builder(appFunctionName: AppFunctionName)

Constructs a ExecuteAppFunctionRequest.Builder.

Parameters
appFunctionName AppFunctionName: The AppFunctionName of the target app function. See AppFunctionMetadata.getName for how to determine this value.
This value cannot be null.

Builder

Added in API level 36
Builder(
    targetPackageName: String,
    functionIdentifier: String)

Constructs a ExecuteAppFunctionRequest.Builder.

Parameters
targetPackageName String: The package name of the app that hosts the app function. See AppFunctionMetadata.getName for how to determine this value.
This value cannot be null.
functionIdentifier String: The unique identifier for the app function to be executed. See AppFunctionMetadata.getName for how to determine this value.
This value cannot be null.

Public methods

build

Added in API level 36
fun build(): ExecuteAppFunctionRequest

Builds the ExecuteAppFunctionRequest.

Return
ExecuteAppFunctionRequest This value cannot be null.

setActivityId

Added in API level 37
fun setActivityId(activityId: AppFunctionActivityId?): ExecuteAppFunctionRequest.Builder

Sets the AppFunctionActivityId.

If the target app function's AppFunctionMetadata.getScope is AppFunctionMetadata.SCOPE_ACTIVITY, this must be set to disambiguate between instances of the same app function running in different activities.

The value must be unset or null if the target app function is not AppFunctionMetadata.SCOPE_ACTIVITY.

The list of valid activity identifiers for a given function name can be obtained by calling AppFunctionManager.getAppFunctionStates. The returned AppFunctionState objects will contain the associated activity IDs via AppFunctionState.getActivityIds().

The list of functions provided by an activity can be obtained by calling AppFunctionManager.getAppFunctionActivityStates.

Parameters
activityId AppFunctionActivityId?: The activity identifier to associate with this request.
This value may be null.

setAttribution

Added in API level 37
fun setAttribution(attribution: AppInteractionAttribution): ExecuteAppFunctionRequest.Builder

Sets the AppInteractionAttribution.

This information can be used by the privacy setting to provide transparency to the user about why an app function was invoked.

This is currently optional, but may become required for apps targeting a future release.

Parameters
attribution AppInteractionAttribution: The attribution for this request.
This value cannot be null.
Return
ExecuteAppFunctionRequest.Builder This value cannot be null.

setExtras

Added in API level 36
fun setExtras(extras: Bundle): ExecuteAppFunctionRequest.Builder

Sets the additional metadata for this function execution request.

Parameters
extras Bundle: The additional metadata for this function execution request.
This value cannot be null.
Return
ExecuteAppFunctionRequest.Builder This value cannot be null.

setParameters

Added in API level 36
fun setParameters(parameters: GenericDocument): ExecuteAppFunctionRequest.Builder

Sets the function parameters as a key-value GenericDocument.

Parameters
parameters GenericDocument: The parameters for this function execution request.
This value cannot be null.
Return
ExecuteAppFunctionRequest.Builder This value cannot be null.