diff options
author | 2024-10-10 15:35:04 +0000 | |
---|---|---|
committer | 2024-10-10 15:37:07 +0000 | |
commit | 67b293f4b5058aaed644c6d5bbb7c5296e2a2f21 (patch) | |
tree | a7e87bec1833c7d9982e099813533491153a7879 /services/appfunctions/java | |
parent | 12c14878c95f6a3e773aba85c39ff67a9e299602 (diff) |
Return early on "cannot execute function"
Flag: android.app.appfunctions.flags.enable_app_function_manager
Test: N/A
Bug: 357551503
Change-Id: Iad317b19d17651088cb8215fbe1907a687b1b9f4
Diffstat (limited to 'services/appfunctions/java')
-rw-r--r-- | services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java index c5fef191c52c..5d574083b326 100644 --- a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java +++ b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java @@ -65,8 +65,6 @@ import com.android.internal.annotations.VisibleForTesting; import com.android.internal.infra.AndroidFuture; import com.android.internal.util.DumpUtils; import com.android.server.SystemService.TargetUser; -import com.android.server.appfunctions.RemoteServiceCaller.RunServiceCallCallback; -import com.android.server.appfunctions.RemoteServiceCaller.ServiceUsageCompleteListener; import java.io.FileDescriptor; import java.io.PrintWriter; @@ -233,6 +231,9 @@ public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub { "Caller does not have permission to execute the" + " appfunction", /* extras= */ null)); + throw new SecurityException( + "Caller does not have permission to execute the" + + " appfunction"); } }) .thenCompose( @@ -380,7 +381,8 @@ public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub { runtimeMetadataSearchSession)); AppFunctionRuntimeMetadata newMetadata = new AppFunctionRuntimeMetadata.Builder(existingMetadata) - .setEnabled(enabledState).build(); + .setEnabled(enabledState) + .build(); AppSearchBatchResult<String, Void> putDocumentBatchResult = runtimeMetadataSearchSession .put( |