Mono.Android
0.0.0.0
Java.Lang.Object
[Android.Runtime.Register("android/app/appfunctions/AppFunctionManager", ApiSince=36, DoNotGenerateAcw=true)]
[<Android.Runtime.Register("android/app/appfunctions/AppFunctionManager", ApiSince=36, DoNotGenerateAcw=true)>]
[System.Runtime.CompilerServices.Nullable(0)]
[<System.Runtime.CompilerServices.Nullable(0)>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
Provides access to App Functions.
Provides access to App Functions. App Functions is currently a
beta/experimental preview feature.
An app function is a piece of functionality that apps expose to the system for cross-app
orchestration.
<h3>Building App Functions</h3>
Most developers should build app functions through the AppFunctions SDK. This SDK library
offers a more convenient and type-safe way to build app functions. The SDK provides predefined
function schemas for common use cases and associated data classes for function parameters and
return values. Apps only have to implement the provided interfaces. Internally, the SDK converts
these data classes into ExecuteAppFunctionRequest#getParameters() and ExecuteAppFunctionResponse#getResultDocument().
<h3>Discovering App Functions</h3>
When there is a package change or the device starts up, the metadata of available functions is
indexed on-device by AppSearchManager. AppSearch stores the indexed information as an
AppFunctionStaticMetadata document. This document contains the functionIdentifier
and the schema information that the app function implements. This allows other apps and the app
itself to discover these functions using the AppSearch search APIs. Visibility to this metadata
document is based on the packages that have visibility to the app providing the app functions.
AppFunction SDK provides a convenient way to achieve this and is the preferred method.
<h3>Executing App Functions</h3>
To execute an app function, the caller app can retrieve the functionIdentifier from
the AppFunctionStaticMetadata document and use it to build an ExecuteAppFunctionRequest. Then, invoke #executeAppFunction with the request to execute
the app function. Callers need the android.permission.EXECUTE_APP_FUNCTIONS permission to
execute app functions from other apps. An app can always execute its own app functions and
doesn't need these permissions. AppFunction SDK provides a convenient way to achieve this and
is the preferred method.
<h3>Example</h3>
An assistant app is trying to fulfill the user request "Save XYZ into my note". The assistant
app should first list all available app functions as AppFunctionStaticMetadata documents
from AppSearch. Then, it should identify an app function that implements the CreateNote
schema. Finally, the assistant app can invoke #executeAppFunction with the functionIdentifier of the chosen function.
Java documentation for android.app.appfunctions.AppFunctionManager.
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.
Field
Mono.Android
0.0.0.0
[Android.Runtime.Register("APP_FUNCTION_STATE_DEFAULT", ApiSince=36)]
[<Android.Runtime.Register("APP_FUNCTION_STATE_DEFAULT", ApiSince=36)>]
[System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionState enum directly instead of this field.", true)]
[<System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionState enum directly instead of this field.", true)>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
Android.App.AppFunctions.AppFunctionState
0
The default state of the app function.
The default state of the app function. Call #setAppFunctionEnabled with this to reset
enabled state to the default value.
Java documentation for android.app.appfunctions.AppFunctionManager.APP_FUNCTION_STATE_DEFAULT.
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.
Field
Mono.Android
0.0.0.0
[Android.Runtime.Register("APP_FUNCTION_STATE_DISABLED", ApiSince=36)]
[<Android.Runtime.Register("APP_FUNCTION_STATE_DISABLED", ApiSince=36)>]
[System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionState enum directly instead of this field.", true)]
[<System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionState enum directly instead of this field.", true)>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
Android.App.AppFunctions.AppFunctionState
2
The app function is disabled.
The app function is disabled. To disable an app function, call #setAppFunctionEnabled
with this value.
Java documentation for android.app.appfunctions.AppFunctionManager.APP_FUNCTION_STATE_DISABLED.
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.
Field
Mono.Android
0.0.0.0
[Android.Runtime.Register("APP_FUNCTION_STATE_ENABLED", ApiSince=36)]
[<Android.Runtime.Register("APP_FUNCTION_STATE_ENABLED", ApiSince=36)>]
[System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionState enum directly instead of this field.", true)]
[<System.Obsolete("This constant will be removed in the future version. Use Android.App.AppFunctions.AppFunctionState enum directly instead of this field.", true)>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
Android.App.AppFunctions.AppFunctionState
1
The app function is enabled.
The app function is enabled. To enable an app function, call #setAppFunctionEnabled
with this value.
Java documentation for android.app.appfunctions.AppFunctionManager.APP_FUNCTION_STATE_ENABLED.
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.
Method
Mono.Android
0.0.0.0
[Android.Runtime.Register("executeAppFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
[<Android.Runtime.Register("executeAppFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/util/concurrent/Executor;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
[Android.Runtime.RequiresPermission("android.permission.EXECUTE_APP_FUNCTIONS")]
[<Android.Runtime.RequiresPermission("android.permission.EXECUTE_APP_FUNCTIONS")>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
System.Void
the request to execute the app function
the executor to run the callback
the cancellation signal to cancel the execution.
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.
Executes the app function.
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.
Method
Mono.Android
0.0.0.0
[Android.Runtime.Register("isAppFunctionEnabled", "(Ljava/lang/String;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
[<Android.Runtime.Register("isAppFunctionEnabled", "(Ljava/lang/String;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
System.Void
the identifier of the app function to check (unique within the
target package) and in most cases, these are automatically generated by the AppFunctions
SDK
the executor to run the request
the callback to receive the function enabled check result
Returns a boolean through a callback, indicating whether the app function is enabled.
Returns a boolean through a callback, indicating whether the app function is enabled.
This method can only check app functions owned by the caller, unlike #isAppFunctionEnabled(String, String, Executor, OutcomeReceiver), which allows specifying a
different target package.
If the operation fails, the callback's OutcomeReceiver#onError is called with
errors:
<ul>
<li>IllegalArgumentException, if the function is not found or the caller does not
have access to it.
</ul>
Java documentation for android.app.appfunctions.AppFunctionManager.isAppFunctionEnabled(java.lang.String, java.util.concurrent.Executor, android.os.OutcomeReceiver<java.lang.Boolean, java.lang.Exception>).
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.
Method
Mono.Android
0.0.0.0
[Android.Runtime.Register("isAppFunctionEnabled", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
[<Android.Runtime.Register("isAppFunctionEnabled", "(Ljava/lang/String;Ljava/lang/String;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
[Android.Runtime.RequiresPermission("android.permission.EXECUTE_APP_FUNCTIONS")]
[<Android.Runtime.RequiresPermission("android.permission.EXECUTE_APP_FUNCTIONS")>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
System.Void
the identifier of the app function to check (unique within the
target package) and in most cases, these are automatically generated by the AppFunctions
SDK
the package name of the app function's owner
the executor to run the request
the callback to receive the function enabled check result
Returns a boolean through a callback, indicating whether the app function is enabled.
Returns a boolean through a callback, indicating whether the app function is enabled.
This method can only check app functions owned by the caller, or those where the caller
has visibility to the owner package and holds the
Manifest.permission#EXECUTE_APP_FUNCTIONS permission.
If the operation fails, the callback's OutcomeReceiver#onError is called with
errors:
<ul>
<li>IllegalArgumentException, if the function is not found or the caller does not
have access to it.
</ul>
Java documentation for android.app.appfunctions.AppFunctionManager.isAppFunctionEnabled(java.lang.String, java.lang.String, java.util.concurrent.Executor, android.os.OutcomeReceiver<java.lang.Boolean, java.lang.Exception>).
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.
Property
Mono.Android
0.0.0.0
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
[<System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)>]
Java.Interop.JniPeerMembers
To be added.
To be added.
To be added.
Method
Mono.Android
0.0.0.0
[Android.Runtime.Register("setAppFunctionEnabled", "(Ljava/lang/String;ILjava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)]
[<Android.Runtime.Register("setAppFunctionEnabled", "(Ljava/lang/String;ILjava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=36)>]
[System.Runtime.Versioning.SupportedOSPlatform("android36.0")]
[<System.Runtime.Versioning.SupportedOSPlatform("android36.0")>]
System.Void
[Android.Runtime.GeneratedEnum]
[<Android.Runtime.GeneratedEnum>]
the identifier of the app function to enable (unique within the
calling package). In most cases, identifiers are automatically generated by the
AppFunctions SDK
the new state of the app function
the executor to run the callback
the callback to receive the result of the function enablement. The call was
successful if no exception was thrown.
Sets the enabled state of the app function owned by the calling package.
Sets the enabled state of the app function owned by the calling package.
If operation fails, the callback's OutcomeReceiver#onError is called with errors:
<ul>
<li>IllegalArgumentException, if the function is not found or the caller does not
have access to it.
</ul>
Java documentation for android.app.appfunctions.AppFunctionManager.setAppFunctionEnabled(java.lang.String, int, java.util.concurrent.Executor, android.os.OutcomeReceiver<java.lang.Void, java.lang.Exception>).
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.
Property
Mono.Android
0.0.0.0
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
[<System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)>]
System.IntPtr
To be added.
To be added.
To be added.
Property
Mono.Android
0.0.0.0
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
[<System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)>]
System.Type
To be added.
To be added.
To be added.