Språk

AppFunctionManager.ExecuteAppFunction Method

Definition

Overloads

ExecuteAppFunction(ExecuteAppFunctionRequest, IExecutor, CancellationSignal, IOutcomeReceiver)

Executes the app function.

[Android.Runtime.Register("executeAppFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
public void ExecuteAppFunction(Android.App.AppFunctions.ExecuteAppFunctionRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.CancellationSignal cancellationSignal, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("executeAppFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
member this.ExecuteAppFunction : Android.App.AppFunctions.ExecuteAppFunctionRequest * Java.Util.Concurrent.IExecutor * Android.OS.CancellationSignal * Android.OS.IOutcomeReceiver -> unit

Parameters

request
ExecuteAppFunctionRequest

the request to execute the app function

executor
IExecutor

the executor to run the callback

cancellationSignal
CancellationSignal

the cancellation signal to cancel the execution.

callback
IOutcomeReceiver

the callback to receive the function execution result or error. <p>If the calling app does not own the app function or does not have android.permission.EXECUTE_APP_FUNCTIONS, the execution result will contain AppFunctionException.ERROR_DENIED. <p>If the caller only has android.permission.EXECUTE_APP_FUNCTIONS, the execution result will contain AppFunctionException.ERROR_DENIED<p>If the function requested for execution is disabled, then the execution result will contain AppFunctionException.ERROR_DISABLED<p>If the cancellation signal is issued, the operation is cancelled and no response is returned to the caller.

Attributes

Remarks

Executes the app function.

Note: Applications can execute functions they define. To execute functions defined in another component, apps would need to have the permission android.permission.EXECUTE_APP_FUNCTIONS.

Java documentation for android.app.appfunctions.AppFunctionManager.executeAppFunction(android.app.appfunctions.ExecuteAppFunctionRequest, java.util.concurrent.Executor, android.os.CancellationSignal, android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse, android.app.appfunctions.AppFunctionException>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ExecuteAppFunction(AppInteractionSession, ExecuteAppFunctionRequest, IExecutor, CancellationSignal, IOutcomeReceiver)

Executes the app function with an AppInteractionSession.

[Android.Runtime.Register("executeAppFunction", "(Landroid/app/AppInteractionSession;Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=37)]
public void ExecuteAppFunction(Android.App.AppInteractionSession appInteractionSession, Android.App.AppFunctions.ExecuteAppFunctionRequest request, Java.Util.Concurrent.IExecutor executor, Android.OS.CancellationSignal cancellationSignal, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("executeAppFunction", "(Landroid/app/AppInteractionSession;Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=37)>]
member this.ExecuteAppFunction : Android.App.AppInteractionSession * Android.App.AppFunctions.ExecuteAppFunctionRequest * Java.Util.Concurrent.IExecutor * Android.OS.CancellationSignal * Android.OS.IOutcomeReceiver -> unit

Parameters

appInteractionSession
AppInteractionSession

the app interaction session to associate with the function execution. This value cannot be null.

request
ExecuteAppFunctionRequest

the request to execute the app function. This value cannot be null.

executor
IExecutor

the executor to run the callback. This value cannot be null. Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

cancellationSignal
CancellationSignal

the cancellation signal to cancel the execution. This value cannot be null.

callback
IOutcomeReceiver

the callback to receive the function execution result or error. This value cannot be null.

Attributes

Remarks

Executes the app function with an AppInteractionSession.

Applications can execute functions they define. To execute functions defined in another component, the caller must have the Manifest.permission.EXECUTE_APP_FUNCTIONS or android.permission.EXECUTE_APP_FUNCTIONS_SYSTEM permissions.

A function can only be executed while its AppFunctionState.isEnabled is true.

See AppFunctionException for possible failures.

Android reference for android.app.appfunctions.AppFunctionManager.executeAppFunction.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to