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