summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-10-11 01:43:52 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-10-11 01:43:52 +0000
commitacdf07350651f36fb243e221b57029ff3e708990 (patch)
tree8422012f31ba2036e876a0aab62355e9d60435d8
parent04f82f97cfe8bd62dff9d7d373735dafd5374f14 (diff)
parent67b293f4b5058aaed644c6d5bbb7c5296e2a2f21 (diff)
Merge "Return early on "cannot execute function"" into main
-rw-r--r--services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java8
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(