The hidl-gen Java backend now supports structures (NOT unions) and types.hal
files.
Bug: 30575790
Change-Id: I6461235a1c469ce1bdb279bfa3d531113c5788f9
diff --git a/Type.cpp b/Type.cpp
index 907a0c2..6ffe7a2 100644
--- a/Type.cpp
+++ b/Type.cpp
@@ -53,6 +53,10 @@
return std::string();
}
+std::string Type::getJavaWrapperType() const {
+ return getJavaType();
+}
+
std::string Type::getJavaSuffix() const {
CHECK(!"Should not be here");
return std::string();
@@ -95,6 +99,24 @@
"" /* extra */);
}
+void Type::emitJavaFieldInitializer(
+ Formatter &out,
+ const std::string &fieldName) const {
+ out << getJavaType()
+ << " "
+ << fieldName
+ << ";\n";
+}
+
+void Type::emitJavaFieldReaderWriter(
+ Formatter &,
+ const std::string &,
+ const std::string &,
+ const std::string &,
+ bool) const {
+ CHECK(!"Should not be here");
+}
+
void Type::handleError(Formatter &out, ErrorMode mode) const {
switch (mode) {
case ErrorMode_Ignore:
@@ -216,7 +238,7 @@
return OK;
}
-status_t Type::emitJavaTypeDeclarations(Formatter &) const {
+status_t Type::emitJavaTypeDeclarations(Formatter &, bool) const {
return OK;
}
@@ -275,5 +297,9 @@
return true;
}
+void Type::getAlignmentAndSize(size_t *, size_t *) const {
+ CHECK(!"Should not be here");
+}
+
} // namespace android