summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2017-05-18 14:50:04 -0500
committerYifan Hong2017-05-19 15:59:29 -0500
commit08e984cdca85894b0f223314a5ae7ecbdfaf23ed (patch)
tree5d780a86ce7697305beb3fb96ec097cf2b5ef47d /parse_xml.cpp
parent9cd9eb0f06e77347beaf141c011fb1989af82475 (diff)
downloadplatform-system-libvintf-08e984cdca85894b0f223314a5ae7ecbdfaf23ed.tar.gz
platform-system-libvintf-08e984cdca85894b0f223314a5ae7ecbdfaf23ed.tar.xz
platform-system-libvintf-08e984cdca85894b0f223314a5ae7ecbdfaf23ed.zip
Rework compat check of ManifestHal vs. MatrixHal
<interface> and <instance> in a compatibility-matrix.hal also needs to be checked in a manifest.hal. Specifically, all instances specified in compatibility-matrix.hal must be present in manifest.hal, although they can span across different tag elements. See tests for samples. For details, see: go/android-treble-vintf-object Test: libvintf_test Test: vintf_object_test Bug: 38395193 Change-Id: Ia009c5a1d779818594efc4c7f485d9fe4f23ed55 Merged-In: Ia009c5a1d779818594efc4c7f485d9fe4f23ed55
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 8caab4f..f2f3096 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -158,8 +158,11 @@ struct XmlNodeConverter : public XmlConverter<Object> {
158 } 158 }
159 inline bool deserialize(Object *o, const std::string &xml) const { 159 inline bool deserialize(Object *o, const std::string &xml) const {
160 DocType *doc = createDocument(xml); 160 DocType *doc = createDocument(xml);
161 bool ret = doc != nullptr 161 if (doc == nullptr) {
162 && deserialize(o, getRootChild(doc)); 162 this->mLastError = "Not a valid XML";
163 return false;
164 }
165 bool ret = deserialize(o, getRootChild(doc));
163 deleteDocument(doc); 166 deleteDocument(doc);
164 return ret; 167 return ret;
165 } 168 }