summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2018-02-02 15:27:29 -0600
committerYifan Hong2018-02-02 15:29:20 -0600
commit0bfbc1259bab9ca9c100e4ab7186e13ffa00d83a (patch)
treef1828e361c11ed4cac84ef68280eeb542bb4d2e2 /parse_xml.cpp
parent6bce1a665aa1bebc6fe3731eeff962c8aae77c62 (diff)
downloadplatform-system-libvintf-0bfbc1259bab9ca9c100e4ab7186e13ffa00d83a.tar.gz
platform-system-libvintf-0bfbc1259bab9ca9c100e4ab7186e13ffa00d83a.tar.xz
platform-system-libvintf-0bfbc1259bab9ca9c100e4ab7186e13ffa00d83a.zip
Do not allow duplicated manifest.vendor-ndk.version.
As specified by VINTF doc in P, the following is not allowed: <manifest...> <vendor-ndk><version>27</version></vendor-ndk> <vendor-ndk><version>27</version></vendor-ndk> </manifest> Test: libvintf_test Change-Id: Ib9d42d2d75b7362c268597bc947c214e03dd5d00 Fixes: 72461606
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 9f53d72..7abbc55 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -866,6 +866,16 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
866 return false; 866 return false;
867 } 867 }
868 868
869 std::set<std::string> vendorNdkVersions;
870 for (const auto& vendorNdk : object->framework.mVendorNdks) {
871 if (vendorNdkVersions.find(vendorNdk.version()) != vendorNdkVersions.end()) {
872 this->mLastError =
873 "Duplicated manifest.vendor-ndk.version " + vendorNdk.version();
874 return false;
875 }
876 vendorNdkVersions.insert(vendorNdk.version());
877 }
878
869 if (!parseOptionalChild(root, systemSdkConverter, {}, &object->framework.mSystemSdk)) { 879 if (!parseOptionalChild(root, systemSdkConverter, {}, &object->framework.mSystemSdk)) {
870 return false; 880 return false;
871 } 881 }