Builder
class Builder
| kotlin.Any | |
| ↳ | android.app.appfunctions.ExecuteAppFunctionRequest.Builder |
Builder for ExecuteAppFunctionRequest.
Summary
| Public constructors | |
|---|---|
Builder(appFunctionName: AppFunctionName)Constructs a |
|
|
Constructs a |
|
| Public methods | |
|---|---|
| ExecuteAppFunctionRequest |
build()Builds the |
| ExecuteAppFunctionRequest.Builder |
setActivityId(activityId: AppFunctionActivityId?)Sets the |
| ExecuteAppFunctionRequest.Builder |
setAttribution(attribution: AppInteractionAttribution)Sets the |
| ExecuteAppFunctionRequest.Builder |
Sets the additional metadata for this function execution request. |
| ExecuteAppFunctionRequest.Builder |
setParameters(parameters: GenericDocument)Sets the function parameters as a key-value |
Public constructors
Builder
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
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
fun build(): ExecuteAppFunctionRequest
Builds the ExecuteAppFunctionRequest.
| Return | |
|---|---|
ExecuteAppFunctionRequest |
This value cannot be null. |
setActivityId
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
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
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
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. |