summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2017-12-11 17:21:19 -0600
committerYifan Hong2017-12-14 17:33:59 -0600
commit2027a49ab65dd24876d30a308beb1500d5123673 (patch)
tree7e85ce0af2c13c9ff29e678c8b7faed912152047 /parse_xml.cpp
parent405270cfed22533d38a3885cf8c6d9219182b069 (diff)
downloadplatform-system-libvintf-2027a49ab65dd24876d30a308beb1500d5123673.tar.gz
platform-system-libvintf-2027a49ab65dd24876d30a308beb1500d5123673.tar.xz
platform-system-libvintf-2027a49ab65dd24876d30a308beb1500d5123673.zip
Implement FCM Version in matrices / manifests.
"level" is an attribute on compatibility matrices / manifests to specify the FCM Version they declare / implement. Value can be "legacy" or a positive number, or empty (for old files). Test: libvintf_test Test: Built manifests / matrices has not changed (because value is "unspecified"). Bug: 69854976 device manfiest must specify FCM Version Bug: 69636193 all matrices should be installed to system image Bug: 64720381 deprecation schedule Change-Id: I15d34343fae4ad79d86bd50e9de8c4f6ac09fdfd Merged-In: I15d34343fae4ad79d86bd50e9de8c4f6ac09fdfd
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 1a0626a..350d10b 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -748,7 +748,9 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
748 void mutateNode(const HalManifest &m, NodeType *root, DocType *d) const override { 748 void mutateNode(const HalManifest &m, NodeType *root, DocType *d) const override {
749 appendAttr(root, "version", m.getMetaVersion()); 749 appendAttr(root, "version", m.getMetaVersion());
750 appendAttr(root, "type", m.mType); 750 appendAttr(root, "type", m.mType);
751 751 if (m.mLevel != Level::UNSPECIFIED) {
752 this->appendAttr(root, "target-level", m.mLevel);
753 }
752 appendChildren(root, manifestHalConverter, m.getHals(), d); 754 appendChildren(root, manifestHalConverter, m.getHals(), d);
753 if (m.mType == SchemaType::DEVICE) { 755 if (m.mType == SchemaType::DEVICE) {
754 appendChild(root, halManifestSepolicyConverter(m.device.mSepolicyVersion, d)); 756 appendChild(root, halManifestSepolicyConverter(m.device.mSepolicyVersion, d));
@@ -762,6 +764,7 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
762 std::vector<ManifestHal> hals; 764 std::vector<ManifestHal> hals;
763 if (!parseAttr(root, "version", &object->mMetaVersion) || 765 if (!parseAttr(root, "version", &object->mMetaVersion) ||
764 !parseAttr(root, "type", &object->mType) || 766 !parseAttr(root, "type", &object->mType) ||
767 !parseOptionalAttr(root, "target-level", Level::UNSPECIFIED, &object->mLevel) ||
765 !parseChildren(root, manifestHalConverter, &hals)) { 768 !parseChildren(root, manifestHalConverter, &hals)) {
766 return false; 769 return false;
767 } 770 }
@@ -858,6 +861,9 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
858 void mutateNode(const CompatibilityMatrix &m, NodeType *root, DocType *d) const override { 861 void mutateNode(const CompatibilityMatrix &m, NodeType *root, DocType *d) const override {
859 appendAttr(root, "version", m.getMinimumMetaVersion()); 862 appendAttr(root, "version", m.getMinimumMetaVersion());
860 appendAttr(root, "type", m.mType); 863 appendAttr(root, "type", m.mType);
864 if (m.mLevel != Level::UNSPECIFIED) {
865 this->appendAttr(root, "level", m.mLevel);
866 }
861 appendChildren(root, matrixHalConverter, iterateValues(m.mHals), d); 867 appendChildren(root, matrixHalConverter, iterateValues(m.mHals), d);
862 if (m.mType == SchemaType::FRAMEWORK) { 868 if (m.mType == SchemaType::FRAMEWORK) {
863 appendChildren(root, matrixKernelConverter, m.framework.mKernels, d); 869 appendChildren(root, matrixKernelConverter, m.framework.mKernels, d);
@@ -872,8 +878,8 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
872 bool buildObject(CompatibilityMatrix *object, NodeType *root) const override { 878 bool buildObject(CompatibilityMatrix *object, NodeType *root) const override {
873 Version version; 879 Version version;
874 std::vector<MatrixHal> hals; 880 std::vector<MatrixHal> hals;
875 if (!parseAttr(root, "version", &version) || 881 if (!parseAttr(root, "version", &version) || !parseAttr(root, "type", &object->mType) ||
876 !parseAttr(root, "type", &object->mType) || 882 !parseOptionalAttr(root, "level", Level::UNSPECIFIED, &object->mLevel) ||
877 !parseChildren(root, matrixHalConverter, &hals)) { 883 !parseChildren(root, matrixHalConverter, &hals)) {
878 return false; 884 return false;
879 } 885 }