diff options
author | 2024-09-16 12:08:53 +0000 | |
---|---|---|
committer | 2024-09-16 12:08:53 +0000 | |
commit | eb3c88b1e6552e98f5c4fb2e99072cf9cab8c83d (patch) | |
tree | b92c279dc69a15be27236e92a20363021083cdfc /services/appfunctions/java | |
parent | a79d51b5460f6a8448cd13fd02031129cd2c0826 (diff) | |
parent | 5cbdda5f2767f7201ebb790f337603dcffb63b05 (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.java | 5 |
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( |