MCPcopy Create free account
hub / github.com/HexHive/NASS / callLocalAsync

Method callLocalAsync

binderlib/include/binder/SafeInterface.h:488–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486
487 template <typename Method>
488 status_t callLocalAsync(const Parcel& data, Parcel* /*reply*/, Method method) {
489 // reply is not actually used by CHECK_INTERFACE
490 CHECK_INTERFACE(this, data, reply);
491
492 // Since we need to both pass inputs into the call as well as retrieve outputs, we create a
493 // "raw" tuple, where the inputs are interleaved with actual, non-pointer versions of the
494 // outputs. When we ultimately call into the method, we will pass the addresses of the
495 // output arguments instead of their tuple members directly, but the storage will live in
496 // the tuple.
497 using ParamTuple = typename SafeInterface::ParamExtractor<Method>::ParamTuple;
498 typename RawConverter<std::tuple<>, ParamTuple>::type rawArgs{};
499
500 // Read the inputs from the data Parcel into the argument tuple
501 status_t error = InputReader<ParamTuple>{mLogTag}.readInputs(data, &rawArgs);
502 if (error != NO_ERROR) [[unlikely]] {
503 // A message will have been logged by read
504 return error;
505 }
506
507 // Call the local method
508 MethodCaller<ParamTuple>::callVoid(this, method, &rawArgs);
509
510 // After calling, there is nothing more to do since asynchronous calls do not return a value
511 // to the caller
512 return NO_ERROR;
513 }
514
515private:
516 const char* const mLogTag;

Callers

nothing calls this directly

Calls 1

readInputsMethod · 0.45

Tested by

no test coverage detected