diff options
author | Steven Moreland <smoreland@google.com> | 2019-10-25 09:59:16 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-10-25 09:59:16 -0700 |
commit | 9b4598fce7ff4edc5b2bc1aa457209c1f3003ed7 (patch) | |
tree | 1d8e4673c15216b0b4f7467740f5d8c6cf221fb6 | |
parent | 9d8ef10fa6d3099e5f7be76e8afbf57ea9191e6e (diff) | |
parent | d05ad0c50fe05ab568413570fdf34329709330f8 (diff) | |
download | hidl-9b4598fce7ff4edc5b2bc1aa457209c1f3003ed7.tar.gz |
Merge "hidl2aidl: recognize Status/Error by typename" am: 81e76c4ddf
am: d05ad0c50f
Change-Id: I41427bbcb3dd8b6d8822be7f9c1fef377e0bcd54
-rw-r--r-- | hidl2aidl/AidlInterface.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hidl2aidl/AidlInterface.cpp b/hidl2aidl/AidlInterface.cpp index bed05dfa..7a334436 100644 --- a/hidl2aidl/AidlInterface.cpp +++ b/hidl2aidl/AidlInterface.cpp @@ -171,10 +171,12 @@ void AidlHelper::emitAidl(const Interface& interface, const Coordinator& coordin std::vector<NamedReference<Type>*> results; std::vector<ResultTransformation> transformations; for (NamedReference<Type>* res : method->results()) { - if (StringHelper::EndsWith(StringHelper::Uppercase(res->name()), "STATUS") || - StringHelper::EndsWith(StringHelper::Uppercase(res->name()), "ERROR")) { - out << "// Ignoring result " << getAidlType(*res->get(), interface.fqName()) - << " " << res->name() << " since AIDL has built in status types.\n"; + const std::string aidlType = getAidlType(*res->get(), interface.fqName()); + + if (StringHelper::EndsWith(StringHelper::Uppercase(aidlType), "STATUS") || + StringHelper::EndsWith(StringHelper::Uppercase(aidlType), "ERROR")) { + out << "// Ignoring result " << aidlType << " " << res->name() + << " since AIDL has built in status types.\n"; transformations.emplace_back(ResultTransformation{ res->name(), ResultTransformation::TransformType::REMOVED}); } else { |