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

Commit eb3c88b1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Unwrap CompletionException for AndroidFuture(s) before translating them...

Merge "Unwrap CompletionException for AndroidFuture(s) before translating them to failure response(s)." into main
parents a79d51b5 5cbdda5f
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ import com.android.server.appfunctions.RemoteServiceCaller.RunServiceCallCallbac
import com.android.server.appfunctions.RemoteServiceCaller.ServiceUsageCompleteListener;
import com.android.server.appfunctions.RemoteServiceCaller.ServiceUsageCompleteListener;


import java.util.Objects;
import java.util.Objects;
import java.util.concurrent.CompletionException;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeUnit;
@@ -255,6 +256,10 @@ public class AppFunctionManagerServiceImpl extends IAppFunctionManager.Stub {
    }
    }


    private ExecuteAppFunctionResponse mapExceptionToExecuteAppFunctionResponse(Throwable e) {
    private ExecuteAppFunctionResponse mapExceptionToExecuteAppFunctionResponse(Throwable e) {
        if(e instanceof CompletionException) {
            e = e.getCause();
        }

        if (e instanceof AppSearchException) {
        if (e instanceof AppSearchException) {
            AppSearchException appSearchException = (AppSearchException) e;
            AppSearchException appSearchException = (AppSearchException) e;
            return ExecuteAppFunctionResponse.newFailure(
            return ExecuteAppFunctionResponse.newFailure(