MQDescriptor is now a predefined type.
b/31091383 Adding WireMQDescriptor as a hidl type
Change-Id: I8eb7f25dd35bc1e33393b9c563152c3a1551419b
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/AST.cpp b/AST.cpp
index f10ad59..b514fe7 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -244,6 +244,13 @@
}
}
+ if (resolvedType == nullptr
+ && fqName.package().empty()
+ && fqName.version().empty()
+ && fqName.name() == "MQDescriptor") {
+ return new PredefinedType("::android::hardware::MQDescriptor");
+ }
+
if (resolvedType) {
#if 0
LOG(INFO) << "found '"
diff --git a/PredefinedType.cpp b/PredefinedType.cpp
index 9c15730..c1468ab 100644
--- a/PredefinedType.cpp
+++ b/PredefinedType.cpp
@@ -25,6 +25,9 @@
: mName(name) {
}
+void PredefinedType::addNamedTypesToSet(std::set<const FQName> &) const {
+ // do nothing
+}
std::string PredefinedType::getCppType(
StorageMode mode,
std::string *extra,
diff --git a/PredefinedType.h b/PredefinedType.h
index 95d7f71..965b786 100644
--- a/PredefinedType.h
+++ b/PredefinedType.h
@@ -25,6 +25,7 @@
struct PredefinedType : public Type {
PredefinedType(const char *name);
+ void addNamedTypesToSet(std::set<const FQName> &set) const override;
std::string getCppType(StorageMode mode,
std::string *extra,
bool specifyNamespaces) const override;
diff --git a/generateCpp.cpp b/generateCpp.cpp
index 2679092..3543e97 100644
--- a/generateCpp.cpp
+++ b/generateCpp.cpp
@@ -147,6 +147,7 @@
out << "#include <hidl/HidlSupport.h>\n";
out << "#include <hidl/IServiceManager.h>\n";
+ out << "#include <hidl/MQDescriptor.h>\n";
if (isInterface) {
out << "#include <hidl/Status.h>\n";
diff --git a/generateCppImpl.cpp b/generateCppImpl.cpp
index baab89f..bed1d1d 100644
--- a/generateCppImpl.cpp
+++ b/generateCppImpl.cpp
@@ -130,6 +130,7 @@
out << "I" << baseName << ".h>\n";
out << "#include <hidl/Status.h>\n\n";
+ out << "#include <hidl/MQDescriptor.h>\n";
enterLeaveNamespace(out, true /* enter */);
out << "namespace implementation {\n\n";
diff --git a/test/data/android/hardware/tests/expression/1.0/IExpression.h b/test/data/android/hardware/tests/expression/1.0/IExpression.h
index 29bfca6..894367b 100644
--- a/test/data/android/hardware/tests/expression/1.0/IExpression.h
+++ b/test/data/android/hardware/tests/expression/1.0/IExpression.h
@@ -3,6 +3,7 @@
#include <hidl/HidlSupport.h>
#include <hidl/IServiceManager.h>
+#include <hidl/MQDescriptor.h>
#include <hidl/Status.h>
#include <utils/NativeHandle.h>