Callback elision for HIDL interfaces.
Test: mma, hidl_test
Bug: 31380743
Change-Id: If5f0dc0279e717dafaf416776be89cc854c6f856
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 @@
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