summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2017-04-12 20:56:37 -0500
committerYifan Hong2017-04-13 20:02:41 -0500
commit9a36158780229984f6d46ad9c1a80d41c1f64d9e (patch)
tree124e6dd186238a65ced526ab4024453a65a6f5b1 /parse_xml.cpp
parent03d2d4a8fa16418a2f54dc78a7e909f40a26ec1b (diff)
downloadplatform-system-libvintf-9a36158780229984f6d46ad9c1a80d41c1f64d9e.tar.gz
platform-system-libvintf-9a36158780229984f6d46ad9c1a80d41c1f64d9e.tar.xz
platform-system-libvintf-9a36158780229984f6d46ad9c1a80d41c1f64d9e.zip
compatibility-matrix.sepolicy.sepolicy-version format
should be 25.0 or 26.0-3; also there can be multiple sepolicy-version entries. Change the code to reflect these. Test: libvintf_test Bug: 36456394 VINTF: add sepolicy version Bug: 36737087 We need a way to identify which "platform version" Change-Id: Iaf660c6326fb42a21b16e8b8129005053a28f01b
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 19ef771..207d4ed 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -543,17 +543,17 @@ struct ManifestHalConverter : public XmlNodeConverter<ManifestHal> {
543const ManifestHalConverter manifestHalConverter{}; 543const ManifestHalConverter manifestHalConverter{};
544 544
545const XmlTextConverter<KernelSepolicyVersion> kernelSepolicyVersionConverter{"kernel-sepolicy-version"}; 545const XmlTextConverter<KernelSepolicyVersion> kernelSepolicyVersionConverter{"kernel-sepolicy-version"};
546const XmlTextConverter<SepolicyVersion> sepolicyVersionConverter{"sepolicy-version"}; 546const XmlTextConverter<VersionRange> sepolicyVersionConverter{"sepolicy-version"};
547 547
548struct SepolicyConverter : public XmlNodeConverter<Sepolicy> { 548struct SepolicyConverter : public XmlNodeConverter<Sepolicy> {
549 std::string elementName() const override { return "sepolicy"; } 549 std::string elementName() const override { return "sepolicy"; }
550 void mutateNode(const Sepolicy &object, NodeType *root, DocType *d) const override { 550 void mutateNode(const Sepolicy &object, NodeType *root, DocType *d) const override {
551 appendChild(root, kernelSepolicyVersionConverter(object.kernelSepolicyVersion(), d)); 551 appendChild(root, kernelSepolicyVersionConverter(object.kernelSepolicyVersion(), d));
552 appendChild(root, sepolicyVersionConverter(object.sepolicyVersion(), d)); 552 appendChildren(root, sepolicyVersionConverter, object.sepolicyVersions(), d);
553 } 553 }
554 bool buildObject(Sepolicy *object, NodeType *root) const override { 554 bool buildObject(Sepolicy *object, NodeType *root) const override {
555 if (!parseChild(root, kernelSepolicyVersionConverter, &object->mKernelSepolicyVersion) || 555 if (!parseChild(root, kernelSepolicyVersionConverter, &object->mKernelSepolicyVersion) ||
556 !parseChild(root, sepolicyVersionConverter, &object->mSepolicyVersion)) { 556 !parseChildren(root, sepolicyVersionConverter, &object->mSepolicyVersionRanges)) {
557 return false; 557 return false;
558 } 558 }
559 return true; 559 return true;