Add ManifestHal::insertInstance
... that allows to add <fqname> to ManifestHal object from code.
This helps, for example, lshal.
Bug: 74247301
Test: pass
Change-Id: I28b5bb1240e24f1762d2df4cb1ded242fabea99e
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 27f31c9..8ccf9b1 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -705,6 +705,12 @@
if (!parseChildren(root, fqInstanceConverter, &fqInstances, error)) {
return false;
}
+ for (const auto& e : fqInstances) {
+ if (e.hasPackage()) {
+ *error = "Should not specify package: \"" + e.string() + "\"";
+ return false;
+ }
+ }
if (!object->insertInstances(fqInstances, error)) {
return false;
}