diff options
author | Yifan Hong | 2018-07-26 13:38:54 -0500 |
---|---|---|
committer | Yifan Hong | 2018-07-26 18:42:05 -0500 |
commit | 86678e40bc70c4fb8aec06256bf49490c24e326f (patch) | |
tree | f7637f656c21cd16c0aef130aa6d3d5b7b44cfc1 /parse_xml.cpp | |
parent | ad6aa914d524ee242de036a02c52402875111554 (diff) | |
download | platform-system-libvintf-86678e40bc70c4fb8aec06256bf49490c24e326f.tar.gz platform-system-libvintf-86678e40bc70c4fb8aec06256bf49490c24e326f.tar.xz platform-system-libvintf-86678e40bc70c4fb8aec06256bf49490c24e326f.zip |
assemble_vintf: add --no-kernel-requirements option
When specified, <config> under <kernel> will not be written to the
output matrix, and kernel minor revision will be set to zero.
These requirements are added in P but is verified against the running
kernel (instead of the incoming kernel). This incorrect behavior
in recovery forces us to drop these requirements during OTA.
These requirements are still checked by VTS.
Bug: 111840577
Test: libvintf_test
Change-Id: Id0d7851f5cc11fbd8e6e2928ce377769855445db
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r-- | parse_xml.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp index fbac04e..7947fc3 100644 --- a/parse_xml.cpp +++ b/parse_xml.cpp | |||
@@ -601,12 +601,23 @@ MatrixKernelConditionsConverter matrixKernelConditionsConverter{}; | |||
601 | 601 | ||
602 | struct MatrixKernelConverter : public XmlNodeConverter<MatrixKernel> { | 602 | struct MatrixKernelConverter : public XmlNodeConverter<MatrixKernel> { |
603 | std::string elementName() const override { return "kernel"; } | 603 | std::string elementName() const override { return "kernel"; } |
604 | void mutateNode(const MatrixKernel &kernel, NodeType *root, DocType *d) const override { | 604 | void mutateNode(const MatrixKernel& kernel, NodeType* root, DocType* d) const override { |
605 | appendAttr(root, "version", kernel.mMinLts); | 605 | mutateNode(kernel, root, d, SerializeFlag::EVERYTHING); |
606 | } | ||
607 | void mutateNode(const MatrixKernel& kernel, NodeType* root, DocType* d, | ||
608 | SerializeFlags flags) const override { | ||
609 | KernelVersion kv = kernel.mMinLts; | ||
610 | if (flags & SerializeFlag::NO_KERNEL_MINOR_REVISION) { | ||
611 | kv.minorRev = 0u; | ||
612 | } | ||
613 | appendAttr(root, "version", kv); | ||
614 | |||
606 | if (!kernel.mConditions.empty()) { | 615 | if (!kernel.mConditions.empty()) { |
607 | appendChild(root, matrixKernelConditionsConverter(kernel.mConditions, d)); | 616 | appendChild(root, matrixKernelConditionsConverter(kernel.mConditions, d)); |
608 | } | 617 | } |
609 | appendChildren(root, kernelConfigConverter, kernel.mConfigs, d); | 618 | if (!(flags & SerializeFlag::NO_KERNEL_CONFIGS)) { |
619 | appendChildren(root, kernelConfigConverter, kernel.mConfigs, d); | ||
620 | } | ||
610 | } | 621 | } |
611 | bool buildObject(MatrixKernel* object, NodeType* root, std::string* error) const override { | 622 | bool buildObject(MatrixKernel* object, NodeType* root, std::string* error) const override { |
612 | if (!parseAttr(root, "version", &object->mMinLts, error) || | 623 | if (!parseAttr(root, "version", &object->mMinLts, error) || |
@@ -1023,7 +1034,7 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri | |||
1023 | } | 1034 | } |
1024 | if (m.mType == SchemaType::FRAMEWORK) { | 1035 | if (m.mType == SchemaType::FRAMEWORK) { |
1025 | if (!(flags & SerializeFlag::NO_KERNEL)) { | 1036 | if (!(flags & SerializeFlag::NO_KERNEL)) { |
1026 | appendChildren(root, matrixKernelConverter, m.framework.mKernels, d); | 1037 | appendChildren(root, matrixKernelConverter, m.framework.mKernels, d, flags); |
1027 | } | 1038 | } |
1028 | if (!(flags & SerializeFlag::NO_SEPOLICY)) { | 1039 | if (!(flags & SerializeFlag::NO_SEPOLICY)) { |
1029 | if (!(m.framework.mSepolicy == Sepolicy{})) { | 1040 | if (!(m.framework.mSepolicy == Sepolicy{})) { |