summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2017-04-12 19:23:49 -0500
committerYifan Hong2017-04-13 20:02:41 -0500
commitf302930a51397aa422355644b5de31439056eb51 (patch)
tree6397efe5735e6d6ef5c86897d667c296dbc32777 /parse_xml.cpp
parentfa2b18bda6b3f8611dc93ebb32209943578a6539 (diff)
downloadplatform-system-libvintf-f302930a51397aa422355644b5de31439056eb51.tar.gz
platform-system-libvintf-f302930a51397aa422355644b5de31439056eb51.tar.xz
platform-system-libvintf-f302930a51397aa422355644b5de31439056eb51.zip
Add avb.vbmeta-version to CompatibilityMatrix and RuntimeInfo
RuntimeInfo fetch avb vbmeta version by reading the following two sysprops: - ro.boot.vbmeta.avb_version - ro.boot.avb_version If the sysprop does not exist, 0.0 is set. Test: libvintf_test Test: adb shell vintf (shows 0.0 because CLs for sysprops are not merged yet) Bug: 35322304 Change-Id: I345bc792d1a7ceb585d246ec657707814b42ceff
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 207d4ed..28806ba 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -647,6 +647,18 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
647 647
648const HalManifestConverter halManifestConverter{}; 648const HalManifestConverter halManifestConverter{};
649 649
650const XmlTextConverter<Version> avbVersionConverter{"vbmeta-version"};
651struct AvbConverter : public XmlNodeConverter<Version> {
652 std::string elementName() const override { return "avb"; }
653 void mutateNode(const Version &m, NodeType *root, DocType *d) const override {
654 appendChild(root, avbVersionConverter(m, d));
655 }
656 bool buildObject(Version *object, NodeType *root) const override {
657 return parseChild(root, avbVersionConverter, object);
658 }
659};
660const AvbConverter avbConverter{};
661
650struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatrix> { 662struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatrix> {
651 std::string elementName() const override { return "compatibility-matrix"; } 663 std::string elementName() const override { return "compatibility-matrix"; }
652 void mutateNode(const CompatibilityMatrix &m, NodeType *root, DocType *d) const override { 664 void mutateNode(const CompatibilityMatrix &m, NodeType *root, DocType *d) const override {
@@ -656,6 +668,7 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
656 if (m.mType == SchemaType::FRAMEWORK) { 668 if (m.mType == SchemaType::FRAMEWORK) {
657 appendChildren(root, matrixKernelConverter, m.framework.mKernels, d); 669 appendChildren(root, matrixKernelConverter, m.framework.mKernels, d);
658 appendChild(root, sepolicyConverter(m.framework.mSepolicy, d)); 670 appendChild(root, sepolicyConverter(m.framework.mSepolicy, d));
671 appendChild(root, avbConverter(m.framework.mAvbMetaVersion, d));
659 } else if (m.mType == SchemaType::DEVICE) { 672 } else if (m.mType == SchemaType::DEVICE) {
660 appendChild(root, vndkConverter(m.device.mVndk, d)); 673 appendChild(root, vndkConverter(m.device.mVndk, d));
661 } 674 }
@@ -671,7 +684,8 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
671 684
672 if (object->mType == SchemaType::FRAMEWORK) { 685 if (object->mType == SchemaType::FRAMEWORK) {
673 if (!parseChildren(root, matrixKernelConverter, &object->framework.mKernels) || 686 if (!parseChildren(root, matrixKernelConverter, &object->framework.mKernels) ||
674 !parseChild(root, sepolicyConverter, &object->framework.mSepolicy)) { 687 !parseChild(root, sepolicyConverter, &object->framework.mSepolicy) ||
688 !parseChild(root, avbConverter, &object->framework.mAvbMetaVersion)) {
675 return false; 689 return false;
676 } 690 }
677 } else if (object->mType == SchemaType::DEVICE) { 691 } else if (object->mType == SchemaType::DEVICE) {