Initial commit of Java backend to hidl-gen.
Change-Id: I38b62637df74d3e5daf702a8996502d0d5726033
diff --git a/Interface.cpp b/Interface.cpp
index 203be93..ab117f2 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -47,6 +47,10 @@
}
}
+std::string Interface::getJavaType() const {
+ return fullJavaName();
+}
+
void Interface::emitReaderWriter(
Formatter &out,
const std::string &name,
@@ -90,5 +94,25 @@
}
}
+void Interface::emitJavaReaderWriter(
+ Formatter &out,
+ const std::string &parcelObj,
+ const std::string &argName,
+ bool isReader) const {
+ if (isReader) {
+ out << fullJavaName()
+ << ".asInterface("
+ << parcelObj
+ << ".readStrongBinder());\n";
+ } else {
+ out << parcelObj
+ << ".writeStrongBinder("
+ << argName
+ << " == null ? null : "
+ << argName
+ << ".asBinder());\n";
+ }
+}
+
} // namespace android