Update hidl-gen for HidlInstrumentor.
* Generate the code to pass the package and interface name to
HidlInstrumentor
Test: make hidl-gen
mma for hardware/interface
run vts -m VibratorHidlTest
Change-Id: Ic370e41b62dc1b81ddb7794682de53e0515f9193
diff --git a/generateCpp.cpp b/generateCpp.cpp
index aa22362..116bc21 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -793,7 +793,8 @@
out << "explicit "
<< klassName
<< "(const ::android::sp<" << ifaceName << "> &_hidl_impl,"
- << " const std::string& prefix);"
+ << " const std::string& HidlInstrumentor_package,"
+ << " const std::string& HidlInstrumentor_interface);"
<< "\n\n";
out << "::android::status_t onTransact(\n";
out.indent();
@@ -1330,7 +1331,7 @@
<< ">(_hidl_impl),\n"
<< " ::android::hardware::HidlInstrumentor(\""
<< mPackage.string()
- << "::"
+ << "\", \""
<< fqName.getInterfaceName()
<< "\") {\n";
@@ -1368,7 +1369,7 @@
}
out << mPackage.string()
- << "::"
+ << "\", \""
<< interfaceName
<< "\") { \n";
out.indent();
@@ -1385,13 +1386,15 @@
out << klassName
<< "::"
<< klassName
- << "(const ::android::sp<" << interfaceName <<"> &_hidl_impl,"
- << " const std::string &prefix)\n";
+ << "(const ::android::sp<" << interfaceName << "> &_hidl_impl,"
+ << " const std::string &HidlInstrumentor_package,"
+ << " const std::string &HidlInstrumentor_interface)\n";
out.indent();
out.indent();
- out << ": ::android::hardware::HidlInstrumentor(prefix) { \n";
+ out << ": ::android::hardware::HidlInstrumentor("
+ << "HidlInstrumentor_package, HidlInstrumentor_interface) {\n";
out.indent();
out << "_hidl_mImpl = _hidl_impl;\n";
out.unindent();
@@ -1852,7 +1855,9 @@
<< "(const ::android::sp<"
<< iface->fullName()
<< "> impl) : ::android::hardware::HidlInstrumentor(\""
- << iface->fqName().string()
+ << mPackage.string()
+ << "\", \""
+ << iface->localName()
<< "\"), mImpl(impl) {";
if (iface->hasOnewayMethods()) {
out << "\n";