Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67b293f4 authored by Oluwarotimi Adesina's avatar Oluwarotimi Adesina
Browse files

Return early on "cannot execute function"

Flag: android.app.appfunctions.flags.enable_app_function_manager
Test: N/A
Bug: 357551503
Change-Id: Iad317b19d17651088cb8215fbe1907a687b1b9f4
parent 12c14878
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -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(