Remove explicit cast from Return<*>.
- also moving failure check to implicit cast operator.
(after talking to malchev@)
Bug: 31348667
Test: pass
Change-Id: I5a136a3596c2fa7c502ce9d53ab754b796d66fed
diff --git a/transport/include/hidl/HidlBinderSupport.h b/transport/include/hidl/HidlBinderSupport.h
index fb209c4..1851870 100644
--- a/transport/include/hidl/HidlBinderSupport.h
+++ b/transport/include/hidl/HidlBinderSupport.h
@@ -372,7 +372,7 @@
[&success, &sm, &serviceName, &binderIface](const auto &chain) { \
::android::hardware::Return<bool> addRet = \
sm->add(chain, serviceName.c_str(), binderIface); \
- success = addRet.isOk() && addRet.get(); \
+ success = addRet.isOk() && addRet; \
}); \
success = success && ret.getStatus().isOk(); \
return success ? ::android::OK : ::android::UNKNOWN_ERROR; \
@@ -393,7 +393,7 @@
sm->registerForNotifications(PACKAGE "::I" #INTERFACE, \
serviceName, \
notification); \
- return success.isOk() && success.get(); \
+ return success.isOk() && success; \
}