summaryrefslogtreecommitdiff
path: root/services/appfunctions/java
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-09-16 12:08:53 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-09-16 12:08:53 +0000
commiteb3c88b1e6552e98f5c4fb2e99072cf9cab8c83d (patch)
treeb92c279dc69a15be27236e92a20363021083cdfc /services/appfunctions/java
parenta79d51b5460f6a8448cd13fd02031129cd2c0826 (diff)
parent5cbdda5f2767f7201ebb790f337603dcffb63b05 (diff)
Merge "Unwrap CompletionException for AndroidFuture(s) before translating them to failure response(s)." into main
Diffstat (limited to 'services/appfunctions/java')
-rw-r--r--services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java
index 269419f70b2f..2362b91c826e 100644
--- a/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java
+++ b/services/appfunctions/java/com/android/server/appfunctions/AppFunctionManagerServiceImpl.java
@@ -38,6 +38,7 @@ import com.android.server.appfunctions.RemoteServiceCaller.RunServiceCallCallbac
import com.android.server.appfunctions.RemoteServiceCaller.ServiceUsageCompleteListener;
import java.util.Objects;
+import java.util.concurrent.CompletionException;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
@@ -255,6 +256,10 @@ public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub {
}
private ExecuteAppFunctionResponse mapExceptionToExecuteAppFunctionResponse(Throwable e) {
+ if(e instanceof CompletionException) {
+ e = e.getCause();
+ }
+
if (e instanceof AppSearchException) {
AppSearchException appSearchException = (AppSearchException) e;
return ExecuteAppFunctionResponse.newFailure(