Builder


class Builder
kotlin.Any
   ↳ android.app.appsearch.functions.ExecuteAppFunctionRequest.Builder

The builder for creating ExecuteAppFunctionRequest instances.

Summary

Public constructors
Builder(packageName: String, functionIdentifier: String)

Creates a new instance of this builder class.

Public methods
ExecuteAppFunctionRequest

Constructs a new ExecuteAppFunctionRequest from the contents of this builder.

ExecuteAppFunctionRequest.Builder
setExtras(extras: Bundle)

Sets the additional metadata relevant to this function execution request.

ExecuteAppFunctionRequest.Builder

Sets parameters for invoking the app function.

ExecuteAppFunctionRequest.Builder
setSha256Certificate(sha256Certificate: ByteArray?)

Sets the expected certificate SHA-256 digests for the target package.

Public constructors

Builder

Builder(
    packageName: String,
    functionIdentifier: String)

Creates a new instance of this builder class.

Parameters
packageName String: The package name of the target app providing the app function to invoke. This value cannot be null.
functionIdentifier String: The identifier used by the AppFunctionService from the target app to uniquely identify the function to be invoked. This value cannot be null.

Public methods

build

fun build(): ExecuteAppFunctionRequest

Constructs a new ExecuteAppFunctionRequest from the contents of this builder.

Return
ExecuteAppFunctionRequest This value cannot be null.

setExtras

fun setExtras(extras: Bundle): ExecuteAppFunctionRequest.Builder

Sets the additional metadata relevant to this function execution request. Defaults to an empty Bundle if not set.

Parameters
extras Bundle: This value cannot be null.
Return
ExecuteAppFunctionRequest.Builder This value cannot be null.

setParameters

fun setParameters(parameters: GenericDocument): ExecuteAppFunctionRequest.Builder

Sets parameters for invoking the app function. Within this GenericDocument, the property names are the names of the function parameters and the property values are the values of those parameters. Defaults to an empty GenericDocument if not set.

Parameters
parameters GenericDocument: This value cannot be null.
Return
ExecuteAppFunctionRequest.Builder This value cannot be null.

setSha256Certificate

fun setSha256Certificate(sha256Certificate: ByteArray?): ExecuteAppFunctionRequest.Builder

Sets the expected certificate SHA-256 digests for the target package. Setting this to null indicates that no certificate digest check will be performed.

SHA-256 certificate digests for a signed application can be retrieved with the apksigner tool that is part of the Android SDK build tools. Use apksigner verify --print-certs path/to/apk.apk to retrieve the SHA-256 certificate digest for the target application. Once retrieved, the SHA-256 certificate digest should be converted to a byte[] by decoding it in base16:

new android.content.pm.Signature(outputDigest).toByteArray();
  
Parameters
sha256Certificate ByteArray?: This value may be null.