summaryrefslogtreecommitdiff
path: root/libs/appfunctions/java
diff options
context:
space:
mode:
author Oluwarotimi Adesina <oadesina@google.com> 2024-10-30 20:18:25 +0000
committer Oluwarotimi Adesina <oadesina@google.com> 2024-10-31 20:55:51 +0000
commit67167c3b4524e709fda6baa67a98612a0f4d2cad (patch)
treeb8515589a3adb33da7aeac034d0b0531fc6d5071 /libs/appfunctions/java
parent3ead620641042b201e94d2b1af91af9e8445d406 (diff)
Split the isAppFunctionEnabled method into two overloads
Flag: android.app.appfunctions.flags.enable_app_function_manager Test: CTS Bug: 376426049 Change-Id: I94c7a73983fea746dbf0815c77cc5e3705974c5d
Diffstat (limited to 'libs/appfunctions/java')
-rw-r--r--libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionManager.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionManager.java b/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionManager.java
index 6870446fc3a0..2075104ff868 100644
--- a/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionManager.java
+++ b/libs/appfunctions/java/com/google/android/appfunctions/sidecar/AppFunctionManager.java
@@ -16,9 +16,11 @@
package com.google.android.appfunctions.sidecar;
+import android.Manifest;
import android.annotation.CallbackExecutor;
import android.annotation.IntDef;
import android.annotation.NonNull;
+import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
import android.annotation.UserHandleAware;
import android.content.Context;
@@ -103,6 +105,12 @@ public final class AppFunctionManager {
* <p>See {@link android.app.appfunctions.AppFunctionManager#executeAppFunction} for the
* documented behaviour of this method.
*/
+ @RequiresPermission(
+ anyOf = {
+ Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED,
+ Manifest.permission.EXECUTE_APP_FUNCTIONS
+ },
+ conditional = true)
public void executeAppFunction(
@NonNull ExecuteAppFunctionRequest sidecarRequest,
@NonNull @CallbackExecutor Executor executor,
@@ -131,6 +139,12 @@ public final class AppFunctionManager {
* <p>See {@link android.app.appfunctions.AppFunctionManager#isAppFunctionEnabled} for the
* documented behaviour of this method.
*/
+ @RequiresPermission(
+ anyOf = {
+ Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED,
+ Manifest.permission.EXECUTE_APP_FUNCTIONS
+ },
+ conditional = true)
public void isAppFunctionEnabled(
@NonNull String functionIdentifier,
@NonNull String targetPackage,
@@ -140,6 +154,19 @@ public final class AppFunctionManager {
}
/**
+ * Returns a boolean through a callback, indicating whether the app function is enabled.
+ *
+ * <p>See {@link android.app.appfunctions.AppFunctionManager#isAppFunctionEnabled} for the
+ * documented behaviour of this method.
+ */
+ public void isAppFunctionEnabled(
+ @NonNull String functionIdentifier,
+ @NonNull Executor executor,
+ @NonNull OutcomeReceiver<Boolean, Exception> callback) {
+ mManager.isAppFunctionEnabled(functionIdentifier, executor, callback);
+ }
+
+ /**
* Sets the enabled state of the app function owned by the calling package.
*
* <p>See {@link android.app.appfunctions.AppFunctionManager#setAppFunctionEnabled} for the