summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Utkarsh Nigam <utkarshnigam@google.com> 2024-11-27 09:55:55 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-11-27 09:55:55 +0000
commit2af6f148556b5c67d5b9ef96f46d3432d774a71d (patch)
treeee3a58d917f7c01f024ff3439ad42ecd9bb3813e
parentf12273cfb073f6cea776aeaa9f5c24a1e7c0e8bf (diff)
parentaf469ac6e78e445c9b15fee1c2dd4bb3a016ae63 (diff)
Merge "Update App Function documentation" into main
-rw-r--r--core/java/android/app/appfunctions/AppFunctionException.java9
-rw-r--r--core/java/android/app/appfunctions/ExecuteAppFunctionRequest.java11
-rw-r--r--core/java/android/app/appfunctions/ExecuteAppFunctionResponse.java11
3 files changed, 28 insertions, 3 deletions
diff --git a/core/java/android/app/appfunctions/AppFunctionException.java b/core/java/android/app/appfunctions/AppFunctionException.java
index cbd1d932ab00..c8d80d3afe43 100644
--- a/core/java/android/app/appfunctions/AppFunctionException.java
+++ b/core/java/android/app/appfunctions/AppFunctionException.java
@@ -29,7 +29,14 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
-/** Represents an app function related errors. */
+/**
+ * Represents an app function related error.
+ *
+ * <p>This exception may include an {@link AppFunctionException#getExtras() Bundle}
+ * containing additional error-specific metadata.
+ *
+ * <p>The AppFunction SDK can expose structured APIs by packing and unpacking this Bundle.
+ */
@FlaggedApi(FLAG_ENABLE_APP_FUNCTION_MANAGER)
public final class AppFunctionException extends Exception implements Parcelable {
/**
diff --git a/core/java/android/app/appfunctions/ExecuteAppFunctionRequest.java b/core/java/android/app/appfunctions/ExecuteAppFunctionRequest.java
index 1557815a8468..a88198a4ec7c 100644
--- a/core/java/android/app/appfunctions/ExecuteAppFunctionRequest.java
+++ b/core/java/android/app/appfunctions/ExecuteAppFunctionRequest.java
@@ -27,7 +27,16 @@ import android.os.Parcelable;
import java.util.Objects;
-/** A request to execute an app function. */
+/**
+ * A request to execute an app function.
+ *
+ * <p>The {@link ExecuteAppFunctionRequest#getParameters()} contains the parameters for the function
+ * to be executed in a GenericDocument. Structured classes defined in the AppFunction SDK can be
+ * converted into GenericDocuments.
+ *
+ * <p>The {@link ExecuteAppFunctionRequest#getExtras()} provides any extra metadata for the request.
+ * Structured APIs can be exposed in the SDK by packing and unpacking this Bundle.
+ */
@FlaggedApi(FLAG_ENABLE_APP_FUNCTION_MANAGER)
public final class ExecuteAppFunctionRequest implements Parcelable {
@NonNull
diff --git a/core/java/android/app/appfunctions/ExecuteAppFunctionResponse.java b/core/java/android/app/appfunctions/ExecuteAppFunctionResponse.java
index acad43b782e5..a4952f486059 100644
--- a/core/java/android/app/appfunctions/ExecuteAppFunctionResponse.java
+++ b/core/java/android/app/appfunctions/ExecuteAppFunctionResponse.java
@@ -27,7 +27,16 @@ import android.os.Parcelable;
import java.util.Objects;
-/** The response to an app function execution. */
+/**
+ * The response to an app function execution.
+ *
+ * <p>The {@link ExecuteAppFunctionResponse#getResultDocument()} contains the function's return
+ * value as a GenericDocument. This can be converted back into a structured class using the
+ * AppFunction SDK.
+ *
+ * <p>The {@link ExecuteAppFunctionResponse#getExtras()} provides any extra metadata returned by the
+ * function. The AppFunction SDK can expose structured APIs by packing and unpacking this Bundle.
+ */
@FlaggedApi(FLAG_ENABLE_APP_FUNCTION_MANAGER)
public final class ExecuteAppFunctionResponse implements Parcelable {
@NonNull