Loading core/java/android/app/appfunctions/AppFunctionService.java +28 −22 Original line number Diff line number Diff line Loading @@ -103,15 +103,20 @@ public abstract class AppFunctionService extends Service { } SafeOneTimeExecuteAppFunctionCallback safeCallback = new SafeOneTimeExecuteAppFunctionCallback(callback); context.getMainExecutor().execute( () -> { try { onExecuteFunction.perform( request, callingPackage, callingPackageSigningInfo, buildCancellationSignal(cancellationCallback), new OutcomeReceiver<>() { new OutcomeReceiver< ExecuteAppFunctionResponse, AppFunctionException>() { @Override public void onResult(ExecuteAppFunctionResponse result) { public void onResult( ExecuteAppFunctionResponse result) { safeCallback.onResult(result); } Loading @@ -121,11 +126,12 @@ public abstract class AppFunctionService extends Service { } }); } catch (Exception ex) { // Apps should handle exceptions. But if they don't, report the error on // behalf of them. // Apps should handle exceptions. But if they don't, report the // error on behalf of them. safeCallback.onError( new AppFunctionException(toErrorCode(ex), ex.getMessage())); } }); } }; } Loading Loading
core/java/android/app/appfunctions/AppFunctionService.java +28 −22 Original line number Diff line number Diff line Loading @@ -103,15 +103,20 @@ public abstract class AppFunctionService extends Service { } SafeOneTimeExecuteAppFunctionCallback safeCallback = new SafeOneTimeExecuteAppFunctionCallback(callback); context.getMainExecutor().execute( () -> { try { onExecuteFunction.perform( request, callingPackage, callingPackageSigningInfo, buildCancellationSignal(cancellationCallback), new OutcomeReceiver<>() { new OutcomeReceiver< ExecuteAppFunctionResponse, AppFunctionException>() { @Override public void onResult(ExecuteAppFunctionResponse result) { public void onResult( ExecuteAppFunctionResponse result) { safeCallback.onResult(result); } Loading @@ -121,11 +126,12 @@ public abstract class AppFunctionService extends Service { } }); } catch (Exception ex) { // Apps should handle exceptions. But if they don't, report the error on // behalf of them. // Apps should handle exceptions. But if they don't, report the // error on behalf of them. safeCallback.onError( new AppFunctionException(toErrorCode(ex), ex.getMessage())); } }); } }; } Loading