diff options
author | 2025-01-29 17:18:08 +0000 | |
---|---|---|
committer | 2025-01-29 17:29:48 +0000 | |
commit | 4b21065917b0bf9d686f644dede703a1ff4ddefa (patch) | |
tree | 47a6c308dd911c7f1c95e0cd7ab9ccae6f4e573c | |
parent | c51fb14c2c11b3df87db3c5cdbd1fed4c82af31e (diff) |
Remove EXECUTE_APP_FUNCTIONS_TRUSTED
Bug: 393122219
Test: atest CtsAppFunctionTestCases
Flag: android.app.appfunctions.flags.enable_app_function_manager
Change-Id: I1038766dc66375c5f9038d88d06b934ed0abc758
14 files changed, 27 insertions, 101 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 17e7d7a258d8..63c476181e6d 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -8893,8 +8893,8 @@ package android.app.appfunctions { } @FlaggedApi("android.app.appfunctions.flags.enable_app_function_manager") public final class AppFunctionManager { - method @RequiresPermission(anyOf={"android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED", android.Manifest.permission.EXECUTE_APP_FUNCTIONS}, conditional=true) public void executeAppFunction(@NonNull android.app.appfunctions.ExecuteAppFunctionRequest, @NonNull java.util.concurrent.Executor, @NonNull android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse,android.app.appfunctions.AppFunctionException>); - method @RequiresPermission(anyOf={"android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED", android.Manifest.permission.EXECUTE_APP_FUNCTIONS}, conditional=true) public void isAppFunctionEnabled(@NonNull String, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>); + method @RequiresPermission(value=android.Manifest.permission.EXECUTE_APP_FUNCTIONS, conditional=true) public void executeAppFunction(@NonNull android.app.appfunctions.ExecuteAppFunctionRequest, @NonNull java.util.concurrent.Executor, @NonNull android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<android.app.appfunctions.ExecuteAppFunctionResponse,android.app.appfunctions.AppFunctionException>); + method @RequiresPermission(value=android.Manifest.permission.EXECUTE_APP_FUNCTIONS, conditional=true) public void isAppFunctionEnabled(@NonNull String, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>); method public void isAppFunctionEnabled(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>); method public void setAppFunctionEnabled(@NonNull String, int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,java.lang.Exception>); field public static final int APP_FUNCTION_STATE_DEFAULT = 0; // 0x0 diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 41f286245d8d..ab824119d643 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -150,7 +150,6 @@ package android { field @FlaggedApi("com.android.window.flags.untrusted_embedding_any_app_permission") public static final String EMBED_ANY_APP_IN_UNTRUSTED_MODE = "android.permission.EMBED_ANY_APP_IN_UNTRUSTED_MODE"; field @FlaggedApi("android.content.pm.emergency_install_permission") public static final String EMERGENCY_INSTALL_PACKAGES = "android.permission.EMERGENCY_INSTALL_PACKAGES"; field public static final String ENTER_CAR_MODE_PRIORITIZED = "android.permission.ENTER_CAR_MODE_PRIORITIZED"; - field @FlaggedApi("android.app.appfunctions.flags.enable_app_function_manager") public static final String EXECUTE_APP_FUNCTIONS_TRUSTED = "android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED"; field public static final String EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS = "android.permission.EXEMPT_FROM_AUDIO_RECORD_RESTRICTIONS"; field public static final String FORCE_BACK = "android.permission.FORCE_BACK"; field public static final String FORCE_STOP_PACKAGES = "android.permission.FORCE_STOP_PACKAGES"; diff --git a/core/java/android/app/appfunctions/AppFunctionManager.java b/core/java/android/app/appfunctions/AppFunctionManager.java index 6fd8db995368..0a3891fe47a1 100644 --- a/core/java/android/app/appfunctions/AppFunctionManager.java +++ b/core/java/android/app/appfunctions/AppFunctionManager.java @@ -72,10 +72,10 @@ import java.util.concurrent.Executor; * <p>To execute an app function, the caller app can retrieve the {@code functionIdentifier} from * the {@code AppFunctionStaticMetadata} document and use it to build an {@link * ExecuteAppFunctionRequest}. Then, invoke {@link #executeAppFunction} with the request to execute - * the app function. Callers need the {@code android.permission.EXECUTE_APP_FUNCTIONS} or {@code - * android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} 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. + * the app function. Callers need the {@code 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> * @@ -141,32 +141,24 @@ public final class AppFunctionManager { * Executes the app function. * * <p>Note: Applications can execute functions they define. To execute functions defined in - * another component, apps would need to have {@code - * android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} or {@code - * android.permission.EXECUTE_APP_FUNCTIONS}. + * another component, apps would need to have the permission + * {@code android.permission.EXECUTE_APP_FUNCTIONS}. * * @param request the request to execute the app function * @param executor the executor to run the callback * @param cancellationSignal the cancellation signal to cancel the execution. * @param callback 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 {@code - * android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} or {@code * android.permission.EXECUTE_APP_FUNCTIONS}, the execution result will contain {@code * AppFunctionException.ERROR_DENIED}. - * <p>If the caller only has {@code android.permission.EXECUTE_APP_FUNCTIONS} but the - * function requires {@code android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED}, the execution + * <p>If the caller only has {@code android.permission.EXECUTE_APP_FUNCTIONS}, the execution * result will contain {@code AppFunctionException.ERROR_DENIED} * <p>If the function requested for execution is disabled, then the execution result will * contain {@code AppFunctionException.ERROR_DISABLED} * <p>If the cancellation signal is issued, the operation is cancelled and no response is * returned to the caller. */ - @RequiresPermission( - anyOf = { - Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, - Manifest.permission.EXECUTE_APP_FUNCTIONS - }, - conditional = true) + @RequiresPermission(value = Manifest.permission.EXECUTE_APP_FUNCTIONS, conditional = true) @UserHandleAware public void executeAppFunction( @NonNull ExecuteAppFunctionRequest request, @@ -222,9 +214,8 @@ public final class AppFunctionManager { * Returns a boolean through a callback, indicating whether the app function is enabled. * * <p>This method can only check app functions owned by the caller, or those where the caller - * has visibility to the owner package and holds either the {@link - * Manifest.permission#EXECUTE_APP_FUNCTIONS} or {@link - * Manifest.permission#EXECUTE_APP_FUNCTIONS_TRUSTED} permission. + * has visibility to the owner package and holds the + * {@link Manifest.permission#EXECUTE_APP_FUNCTIONS} permission. * * <p>If the operation fails, the callback's {@link OutcomeReceiver#onError} is called with * errors: @@ -241,12 +232,7 @@ public final class AppFunctionManager { * @param executor the executor to run the request * @param callback the callback to receive the function enabled check result */ - @RequiresPermission( - anyOf = { - Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, - Manifest.permission.EXECUTE_APP_FUNCTIONS - }, - conditional = true) + @RequiresPermission(value = Manifest.permission.EXECUTE_APP_FUNCTIONS, conditional = true) public void isAppFunctionEnabled( @NonNull String functionIdentifier, @NonNull String targetPackage, diff --git a/core/java/android/app/appfunctions/AppFunctionManagerHelper.java b/core/java/android/app/appfunctions/AppFunctionManagerHelper.java index 64dece99c5d1..cc3ca03f423d 100644 --- a/core/java/android/app/appfunctions/AppFunctionManagerHelper.java +++ b/core/java/android/app/appfunctions/AppFunctionManagerHelper.java @@ -54,9 +54,8 @@ public class AppFunctionManagerHelper { * Returns (through a callback) a boolean 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 either the {@link - * Manifest.permission#EXECUTE_APP_FUNCTIONS} or {@link - * Manifest.permission#EXECUTE_APP_FUNCTIONS_TRUSTED} permission. + * has visibility to the owner package and holds the {@link + * Manifest.permission#EXECUTE_APP_FUNCTIONS} permission. * * <p>If operation fails, the callback's {@link OutcomeReceiver#onError} is called with errors: * diff --git a/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java b/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java index 3ddda228d145..7743d4862b51 100644 --- a/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java +++ b/core/java/android/app/appfunctions/AppFunctionRuntimeMetadata.java @@ -90,8 +90,7 @@ public class AppFunctionRuntimeMetadata extends GenericDocument { * we need to have per-package app function schemas. * * <p>This schema should be set visible to callers from the package owner itself and for callers - * with {@link android.Manifest.permission#EXECUTE_APP_FUNCTIONS} or {@link - * android.Manifest.permission#EXECUTE_APP_FUNCTIONS_TRUSTED} permissions. + * with the permission {@link android.Manifest.permission#EXECUTE_APP_FUNCTIONS}. * * @param packageName The package name to create a schema for. */ @@ -105,9 +104,8 @@ public class AppFunctionRuntimeMetadata extends GenericDocument { /** * Creates a parent schema for all app function runtime schemas. * - * <p>This schema should be set visible to the owner itself and for callers with {@link - * android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} or {@link - * android.permission.EXECUTE_APP_FUNCTIONS} permissions. + * <p>This schema should be set visible to the owner itself and for callers with + * the permission {@link android.permission.EXECUTE_APP_FUNCTIONS}. */ public static AppSearchSchema createParentAppFunctionRuntimeSchema() { return getAppFunctionRuntimeSchemaBuilder(RUNTIME_SCHEMA_TYPE).build(); diff --git a/core/java/android/app/appfunctions/IAppFunctionManager.aidl b/core/java/android/app/appfunctions/IAppFunctionManager.aidl index 72335e40c207..098e1fe8b516 100644 --- a/core/java/android/app/appfunctions/IAppFunctionManager.aidl +++ b/core/java/android/app/appfunctions/IAppFunctionManager.aidl @@ -34,7 +34,7 @@ interface IAppFunctionManager { * @param request the request to execute an app function. * @param callback the callback to report the result. */ - @JavaPassthrough(annotation="@android.annotation.RequiresPermission(anyOf = {android.Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED,android.Manifest.permission.EXECUTE_APP_FUNCTIONS}, conditional = true)") + @JavaPassthrough(annotation="@android.annotation.RequiresPermission(value = android.Manifest.permission.EXECUTE_APP_FUNCTIONS, conditional = true)") ICancellationSignal executeAppFunction( in ExecuteAppFunctionAidlRequest request, in IExecuteAppFunctionCallback callback diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index aad8f8a156b5..005c14ddcf69 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -8308,26 +8308,9 @@ android:featureFlag="android.app.appfunctions.flags.enable_app_function_manager" android:protectionLevel="signature" /> - <!-- Allows a trusted application to perform actions on behalf of users inside of - applications with privacy guarantees from the system. - <p>This permission is currently only granted to system packages in the - {@link android.app.role.SYSTEM_UI_INTELLIGENCE} role which complies with privacy - requirements outlined in the Android CDD section "9.8.6 Content Capture". - <p>Apps are not able to opt-out from caller having this permission. - <p>Protection level: internal|role - @SystemApi - @hide - @FlaggedApi(android.app.appfunctions.flags.Flags.FLAG_ENABLE_APP_FUNCTION_MANAGER) --> - <permission android:name="android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED" - android:featureFlag="android.app.appfunctions.flags.enable_app_function_manager" - android:protectionLevel="internal|role" /> - <!-- Allows an application to perform actions on behalf of users inside of applications. <p>This permission is currently only granted to privileged system apps. - <p>Apps contributing app functions can opt to disallow callers with this permission, - limiting to only callers with {@link android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED} - instead. <p>Protection level: internal|privileged @FlaggedApi(android.app.appfunctions.flags.Flags.FLAG_ENABLE_APP_FUNCTION_MANAGER) --> <permission android:name="android.permission.EXECUTE_APP_FUNCTIONS" diff --git a/data/etc/privapp-permissions-platform.xml b/data/etc/privapp-permissions-platform.xml index b8059d08756a..1edbffa9d572 100644 --- a/data/etc/privapp-permissions-platform.xml +++ b/data/etc/privapp-permissions-platform.xml @@ -594,7 +594,6 @@ applications that come with the platform <!-- Permission required for CTS test - FileIntegrityManagerTest --> <permission name="android.permission.SETUP_FSVERITY" /> <!-- Permissions required for CTS test - AppFunctionManagerTest --> - <permission name="android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED" /> <permission name="android.permission.EXECUTE_APP_FUNCTIONS" /> <!-- Permission required for CTS test - CtsNfcTestCases --> <permission name="android.permission.NFC_SET_CONTROLLER_ALWAYS_ON" /> diff --git a/libs/appfunctions/api/current.txt b/libs/appfunctions/api/current.txt index 139ccfd22b0e..7280b12aaca9 100644 --- a/libs/appfunctions/api/current.txt +++ b/libs/appfunctions/api/current.txt @@ -24,8 +24,8 @@ package com.android.extensions.appfunctions { public final class AppFunctionManager { ctor public AppFunctionManager(android.content.Context); - method @RequiresPermission(anyOf={android.Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, android.Manifest.permission.EXECUTE_APP_FUNCTIONS}, conditional=true) public void executeAppFunction(@NonNull com.android.extensions.appfunctions.ExecuteAppFunctionRequest, @NonNull java.util.concurrent.Executor, @NonNull android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<com.android.extensions.appfunctions.ExecuteAppFunctionResponse,com.android.extensions.appfunctions.AppFunctionException>); - method @RequiresPermission(anyOf={android.Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, android.Manifest.permission.EXECUTE_APP_FUNCTIONS}, conditional=true) public void isAppFunctionEnabled(@NonNull String, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>); + method @RequiresPermission(android.Manifest.permission.EXECUTE_APP_FUNCTIONS) public void executeAppFunction(@NonNull com.android.extensions.appfunctions.ExecuteAppFunctionRequest, @NonNull java.util.concurrent.Executor, @NonNull android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<com.android.extensions.appfunctions.ExecuteAppFunctionResponse,com.android.extensions.appfunctions.AppFunctionException>); + method @RequiresPermission(android.Manifest.permission.EXECUTE_APP_FUNCTIONS) public void isAppFunctionEnabled(@NonNull String, @NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>); method public void isAppFunctionEnabled(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Boolean,java.lang.Exception>); method public void setAppFunctionEnabled(@NonNull String, int, @NonNull java.util.concurrent.Executor, @NonNull android.os.OutcomeReceiver<java.lang.Void,java.lang.Exception>); field public static final int APP_FUNCTION_STATE_DEFAULT = 0; // 0x0 diff --git a/libs/appfunctions/java/com/android/extensions/appfunctions/AppFunctionManager.java b/libs/appfunctions/java/com/android/extensions/appfunctions/AppFunctionManager.java index 9eb66a33fedc..1e31390854b8 100644 --- a/libs/appfunctions/java/com/android/extensions/appfunctions/AppFunctionManager.java +++ b/libs/appfunctions/java/com/android/extensions/appfunctions/AppFunctionManager.java @@ -104,12 +104,7 @@ 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) + @RequiresPermission(Manifest.permission.EXECUTE_APP_FUNCTIONS) public void executeAppFunction( @NonNull ExecuteAppFunctionRequest sidecarRequest, @NonNull @CallbackExecutor Executor executor, @@ -150,12 +145,7 @@ 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) + @RequiresPermission(Manifest.permission.EXECUTE_APP_FUNCTIONS) public void isAppFunctionEnabled( @NonNull String functionIdentifier, @NonNull String targetPackage, diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml index 2b4e65f2415c..9ab8aa8898a3 100644 --- a/packages/Shell/AndroidManifest.xml +++ b/packages/Shell/AndroidManifest.xml @@ -952,7 +952,6 @@ <uses-permission android:name="android.permission.SETUP_FSVERITY" /> <!-- Permissions required for CTS test - AppFunctionManagerTest --> - <uses-permission android:name="android.permission.EXECUTE_APP_FUNCTIONS_TRUSTED" /> <uses-permission android:name="android.permission.EXECUTE_APP_FUNCTIONS" /> <!-- Permission required for CTS test - CtsNfcTestCases --> diff --git a/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java b/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java index 61917676e88d..98ef974b9443 100644 --- a/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java +++ b/services/appfunctions/java/com/android/server/appfunctions/CallerValidator.java @@ -60,9 +60,7 @@ public interface CallerValidator { * Validates that the caller can execute the specified app function. * * <p>The caller can execute if the app function's package name is the same as the caller's - * package or the caller has either {@link Manifest.permission#EXECUTE_APP_FUNCTIONS_TRUSTED} or - * {@link Manifest.permission#EXECUTE_APP_FUNCTIONS} granted. In some cases, app functions can - * still opt-out of caller having {@link Manifest.permission#EXECUTE_APP_FUNCTIONS}. + * package or the caller has the {@link Manifest.permission#EXECUTE_APP_FUNCTIONS} granted. * * @param callingUid The calling uid. * @param callingPid The calling pid. diff --git a/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java b/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java index 69481c32baf0..fe163d77c4fc 100644 --- a/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java +++ b/services/appfunctions/java/com/android/server/appfunctions/CallerValidatorImpl.java @@ -18,7 +18,6 @@ package com.android.server.appfunctions; import static android.app.appfunctions.AppFunctionStaticMetadataHelper.APP_FUNCTION_STATIC_METADATA_DB; import static android.app.appfunctions.AppFunctionStaticMetadataHelper.APP_FUNCTION_STATIC_NAMESPACE; -import static android.app.appfunctions.AppFunctionStaticMetadataHelper.STATIC_PROPERTY_RESTRICT_CALLERS_WITH_EXECUTE_APP_FUNCTIONS; import static android.app.appfunctions.AppFunctionStaticMetadataHelper.getDocumentIdForAppFunction; import static com.android.server.appfunctions.AppFunctionExecutors.THREAD_POOL_EXECUTOR; @@ -84,12 +83,7 @@ class CallerValidatorImpl implements CallerValidator { } @Override - @RequiresPermission( - anyOf = { - Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, - Manifest.permission.EXECUTE_APP_FUNCTIONS - }, - conditional = true) + @RequiresPermission(Manifest.permission.EXECUTE_APP_FUNCTIONS) public AndroidFuture<Boolean> verifyCallerCanExecuteAppFunction( int callingUid, int callingPid, @@ -101,17 +95,6 @@ class CallerValidatorImpl implements CallerValidator { return AndroidFuture.completedFuture(true); } - boolean hasTrustedExecutionPermission = - mContext.checkPermission( - Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, - callingPid, - callingUid) - == PackageManager.PERMISSION_GRANTED; - - if (hasTrustedExecutionPermission) { - return AndroidFuture.completedFuture(true); - } - boolean hasExecutionPermission = mContext.checkPermission( Manifest.permission.EXECUTE_APP_FUNCTIONS, callingPid, callingUid) @@ -138,7 +121,8 @@ class CallerValidatorImpl implements CallerValidator { .build()) .thenApply( batchResult -> getGenericDocumentFromBatchResult(batchResult, documentId)) - .thenApply(document -> !getRestrictCallersWithExecuteAppFunctionsProperty(document)) + // At this point, already checked the app has the permission. + .thenApply(document -> true) .whenComplete( (result, throwable) -> { futureAppSearchSession.close(); @@ -160,12 +144,6 @@ class CallerValidatorImpl implements CallerValidator { + failedResult.getErrorMessage()); } - private static boolean getRestrictCallersWithExecuteAppFunctionsProperty( - GenericDocument genericDocument) { - return genericDocument.getPropertyBoolean( - STATIC_PROPERTY_RESTRICT_CALLERS_WITH_EXECUTE_APP_FUNCTIONS); - } - @Override public boolean verifyEnterprisePolicyIsAllowed( @NonNull UserHandle callingUser, @NonNull UserHandle targetUser) { diff --git a/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java b/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java index cc73288cdbfa..9d13e37b2503 100644 --- a/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java +++ b/services/appfunctions/java/com/android/server/appfunctions/MetadataSyncAdapter.java @@ -78,7 +78,6 @@ public class MetadataSyncAdapter { // Hidden constants in {@link SetSchemaRequest} that restricts runtime metadata visibility // by permissions. public static final int EXECUTE_APP_FUNCTIONS = 9; - public static final int EXECUTE_APP_FUNCTIONS_TRUSTED = 10; public MetadataSyncAdapter( @NonNull PackageManager packageManager, @NonNull AppSearchManager appSearchManager) { @@ -281,8 +280,6 @@ public class MetadataSyncAdapter { new PackageIdentifier(packageName, packageCert)); setSchemaRequestBuilder.addRequiredPermissionsForSchemaTypeVisibility( runtimeMetadataSchema.getSchemaType(), Set.of(EXECUTE_APP_FUNCTIONS)); - setSchemaRequestBuilder.addRequiredPermissionsForSchemaTypeVisibility( - runtimeMetadataSchema.getSchemaType(), Set.of(EXECUTE_APP_FUNCTIONS_TRUSTED)); } return setSchemaRequestBuilder.build(); } |