Fix HIDL output errata.
Some missing newlines and redundant comments.
Bug: N/A
Test: manually inspecting output
Change-Id: Ic8bd6f44ce32b04378d92c1b5d558c7b3a9433a8
diff --git a/Interface.cpp b/Interface.cpp
index 6c5c764..9e53e1f 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -141,7 +141,7 @@
{
{IMPL_INTERFACE,
[](auto &out) {
- out << "return true;";
+ out << "return true;\n";
}
},
{IMPL_PROXY,
@@ -180,7 +180,7 @@
<< "_hidl_mDeathRecipients.erase(it);\n"
<< "return status == ::android::OK;\n";
});
- });
+ }).endl();
out << "}\n";
out << "return false;\n";
}
@@ -212,10 +212,10 @@
HIDL_SYSPROPS_CHANGED_TRANSACTION,
{ { IMPL_INTERFACE, [](auto &out) {
out << "::android::report_sysprop_change();\n";
- out << "return ::android::hardware::Void();";
+ out << "return ::android::hardware::Void();\n";
} } }, /*cppImpl */
{ { IMPL_INTERFACE, [](auto &out) { /* javaImpl */
- out << "android.os.HwBinder.enableInstrumentation();";
+ out << "android.os.HwBinder.enableInstrumentation();\n";
} } } /*javaImpl */
);
return true;
@@ -281,7 +281,7 @@
out << ",\n";
out << chain[i]->fullJavaName() << ".kInterfaceName";
}
- out << "));";
+ out << "));\n";
out.unindent(); out.unindent();
} } } /* javaImpl */
);
@@ -353,7 +353,7 @@
out << "_hidl_cb("
<< fullName()
<< "::descriptor);\n"
- << "return ::android::hardware::Void();";
+ << "return ::android::hardware::Void();\n";
} } }, /* cppImpl */
{ { IMPL_INTERFACE, [this](auto &out) {
out << "return "
@@ -385,7 +385,7 @@
out << "_hidl_cb({ -1 /* pid */, 0 /* ptr */, \n"
<< sArch
<< "});\n"
- << "return ::android::hardware::Void();";
+ << "return ::android::hardware::Void();\n";
}
},
{IMPL_STUB_IMPL,
@@ -398,7 +398,7 @@
<< sArch << "\n";
});
out << ");\n"
- << "return ::android::hardware::Void();";
+ << "return ::android::hardware::Void();\n";
}
}
}, /* cppImpl */
@@ -409,7 +409,7 @@
<< "info.pid = android.os.HidlSupport.getPidIfSharable();\n"
<< "info.ptr = 0;\n"
<< "info.arch = android.hidl.base.V1_0.DebugInfo.Architecture.UNKNOWN;\n"
- << "return info;";
+ << "return info;\n";
} } } /* javaImpl */
);
@@ -428,7 +428,7 @@
[](auto &out) {
out << "(void)fd;\n"
<< "(void)options;\n"
- << "return ::android::hardware::Void();";
+ << "return ::android::hardware::Void();\n";
}
},
}, /* cppImpl */
diff --git a/generateCpp.cpp b/generateCpp.cpp
index 55a486e..6d9c4b7 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -140,8 +140,7 @@
const std::string interfaceName = fqName.getInterfaceName();
const std::string functionName = isTry ? "tryGetService" : "getService";
- out << "// static\n"
- << "::android::sp<" << interfaceName << "> " << interfaceName << "::" << functionName << "("
+ out << "::android::sp<" << interfaceName << "> " << interfaceName << "::" << functionName << "("
<< "const std::string &serviceName, const bool getStub) ";
out.block([&] {
out << "return ::android::hardware::details::getServiceInternal<"
@@ -1716,7 +1715,7 @@
});
for (const Interface *superType : iface->typeChain()) {
- out << "// static \n::android::hardware::Return<"
+ out << "::android::hardware::Return<"
<< childTypeResult
<< "> "
<< iface->localName()