summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2018-02-12 15:33:17 -0600
committerYifan Hong2018-02-12 15:36:14 -0600
commitc393c7104f256a1bdcc870118ee9cc3b701d2045 (patch)
treed1fd68449b9b8391e7bc204f5ea549e51f9d5084 /parse_xml.cpp
parent947570619d88bc6b9ca87f567943987f70a3905a (diff)
downloadplatform-system-libvintf-c393c7104f256a1bdcc870118ee9cc3b701d2045.tar.gz
platform-system-libvintf-c393c7104f256a1bdcc870118ee9cc3b701d2045.tar.xz
platform-system-libvintf-c393c7104f256a1bdcc870118ee9cc3b701d2045.zip
Only "level" for FCM and "target-level" for dev manifest.
The level attribute for device CM and fwk manifest is different and has not been finalize yet. Do not modify the mLevel field for them. Test: libvintf_test Test: vintf_object_test Bug: 37226359 Change-Id: I7b541f6d906fbf03487845be0728172e03bb60a5
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 739e344..bca26e1 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -806,9 +806,6 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
806 SerializeFlags flags) const override { 806 SerializeFlags flags) const override {
807 appendAttr(root, "version", m.getMetaVersion()); 807 appendAttr(root, "version", m.getMetaVersion());
808 appendAttr(root, "type", m.mType); 808 appendAttr(root, "type", m.mType);
809 if (m.mLevel != Level::UNSPECIFIED) {
810 this->appendAttr(root, "target-level", m.mLevel);
811 }
812 809
813 if (!(flags & SerializeFlag::NO_HALS)) { 810 if (!(flags & SerializeFlag::NO_HALS)) {
814 appendChildren(root, manifestHalConverter, m.getHals(), d); 811 appendChildren(root, manifestHalConverter, m.getHals(), d);
@@ -817,6 +814,9 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
817 if (!(flags & SerializeFlag::NO_SEPOLICY)) { 814 if (!(flags & SerializeFlag::NO_SEPOLICY)) {
818 appendChild(root, halManifestSepolicyConverter(m.device.mSepolicyVersion, d)); 815 appendChild(root, halManifestSepolicyConverter(m.device.mSepolicyVersion, d));
819 } 816 }
817 if (m.mLevel != Level::UNSPECIFIED) {
818 this->appendAttr(root, "target-level", m.mLevel);
819 }
820 } else if (m.mType == SchemaType::FRAMEWORK) { 820 } else if (m.mType == SchemaType::FRAMEWORK) {
821 if (!(flags & SerializeFlag::NO_VNDK)) { 821 if (!(flags & SerializeFlag::NO_VNDK)) {
822#pragma clang diagnostic push 822#pragma clang diagnostic push
@@ -841,7 +841,6 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
841 std::vector<ManifestHal> hals; 841 std::vector<ManifestHal> hals;
842 if (!parseAttr(root, "version", &object->mMetaVersion, error) || 842 if (!parseAttr(root, "version", &object->mMetaVersion, error) ||
843 !parseAttr(root, "type", &object->mType, error) || 843 !parseAttr(root, "type", &object->mType, error) ||
844 !parseOptionalAttr(root, "target-level", Level::UNSPECIFIED, &object->mLevel, error) ||
845 !parseChildren(root, manifestHalConverter, &hals, error)) { 844 !parseChildren(root, manifestHalConverter, &hals, error)) {
846 return false; 845 return false;
847 } 846 }
@@ -858,6 +857,11 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
858 &object->device.mSepolicyVersion, error)) { 857 &object->device.mSepolicyVersion, error)) {
859 return false; 858 return false;
860 } 859 }
860
861 if (!parseOptionalAttr(root, "target-level", Level::UNSPECIFIED, &object->mLevel,
862 error)) {
863 return false;
864 }
861 } else if (object->mType == SchemaType::FRAMEWORK) { 865 } else if (object->mType == SchemaType::FRAMEWORK) {
862#pragma clang diagnostic push 866#pragma clang diagnostic push
863#pragma clang diagnostic ignored "-Wdeprecated-declarations" 867#pragma clang diagnostic ignored "-Wdeprecated-declarations"
@@ -963,9 +967,6 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
963 SerializeFlags flags) const override { 967 SerializeFlags flags) const override {
964 appendAttr(root, "version", m.getMinimumMetaVersion()); 968 appendAttr(root, "version", m.getMinimumMetaVersion());
965 appendAttr(root, "type", m.mType); 969 appendAttr(root, "type", m.mType);
966 if (m.mLevel != Level::UNSPECIFIED) {
967 this->appendAttr(root, "level", m.mLevel);
968 }
969 970
970 if (!(flags & SerializeFlag::NO_HALS)) { 971 if (!(flags & SerializeFlag::NO_HALS)) {
971 appendChildren(root, matrixHalConverter, iterateValues(m.mHals), d); 972 appendChildren(root, matrixHalConverter, iterateValues(m.mHals), d);
@@ -984,6 +985,9 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
984 appendChild(root, avbConverter(m.framework.mAvbMetaVersion, d)); 985 appendChild(root, avbConverter(m.framework.mAvbMetaVersion, d));
985 } 986 }
986 } 987 }
988 if (m.mLevel != Level::UNSPECIFIED) {
989 this->appendAttr(root, "level", m.mLevel);
990 }
987 } else if (m.mType == SchemaType::DEVICE) { 991 } else if (m.mType == SchemaType::DEVICE) {
988 if (!(flags & SerializeFlag::NO_VNDK)) { 992 if (!(flags & SerializeFlag::NO_VNDK)) {
989#pragma clang diagnostic push 993#pragma clang diagnostic push
@@ -1015,7 +1019,6 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
1015 std::vector<MatrixHal> hals; 1019 std::vector<MatrixHal> hals;
1016 if (!parseAttr(root, "version", &version, error) || 1020 if (!parseAttr(root, "version", &version, error) ||
1017 !parseAttr(root, "type", &object->mType, error) || 1021 !parseAttr(root, "type", &object->mType, error) ||
1018 !parseOptionalAttr(root, "level", Level::UNSPECIFIED, &object->mLevel, error) ||
1019 !parseChildren(root, matrixHalConverter, &hals, error)) { 1022 !parseChildren(root, matrixHalConverter, &hals, error)) {
1020 return false; 1023 return false;
1021 } 1024 }
@@ -1045,6 +1048,10 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
1045 seenKernelVersions.insert(minLts); 1048 seenKernelVersions.insert(minLts);
1046 } 1049 }
1047 1050
1051 if (!parseOptionalAttr(root, "level", Level::UNSPECIFIED, &object->mLevel, error)) {
1052 return false;
1053 }
1054
1048 } else if (object->mType == SchemaType::DEVICE) { 1055 } else if (object->mType == SchemaType::DEVICE) {
1049 // <vndk> can be missing because it can be determined at build time, not hard-coded 1056 // <vndk> can be missing because it can be determined at build time, not hard-coded
1050 // in the XML file. 1057 // in the XML file.