diff options
author | Martijn Coenen <maco@google.com> | 2017-01-02 15:20:38 +0100 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2017-01-05 08:58:11 +0100 |
commit | d272cb9e881c0aa23e4964f101131ab68affd85d (patch) | |
tree | 63227aa465afcd18aadf115dd332d9ae14075a25 /libhidlmemory | |
parent | 7e6404dd880b1f25c932f264c0ba2e00e79c536e (diff) | |
download | libhidl-d272cb9e881c0aa23e4964f101131ab68affd85d.tar.gz |
Callback elision for HIDL interfaces.
Test: mma, hidl_test
Bug: 31380743
Change-Id: If5f0dc0279e717dafaf416776be89cc854c6f856
Diffstat (limited to 'libhidlmemory')
-rw-r--r-- | libhidlmemory/mapping.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/libhidlmemory/mapping.cpp b/libhidlmemory/mapping.cpp index b4fa123..3761f99 100644 --- a/libhidlmemory/mapping.cpp +++ b/libhidlmemory/mapping.cpp @@ -40,19 +40,14 @@ sp<IMemory> mapMemory(const hidl_memory &memory) { LOG(FATAL) << "IMapper must be a passthrough service."; } - sp<IMemory> retMemory = nullptr; - - Return<void> ret = mapper->mapMemory(memory, - [&retMemory](const auto &mapped) { - retMemory = mapped; - }); + Return<sp<IMemory>> ret = mapper->mapMemory(memory); if (!ret.isOk()) { LOG(FATAL) << "hidl_memory map returned transport error."; } - return retMemory; + return ret; } } // namespace hardware -} // namespace android
\ No newline at end of file +} // namespace android |