summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYifan Hong2018-01-17 15:40:35 -0600
committerYifan Hong2018-01-18 19:01:14 -0600
commita28729e759ec4041d8c53d365b690b0782ea8b03 (patch)
tree550d7508fc6e621fda63af964591d2efca9f4e96 /parse_xml.cpp
parent5a93bf2e5ddc1c14d0c85fb28795625423f3d246 (diff)
downloadplatform-system-libvintf-a28729e759ec4041d8c53d365b690b0782ea8b03.tar.gz
platform-system-libvintf-a28729e759ec4041d8c53d365b690b0782ea8b03.tar.xz
platform-system-libvintf-a28729e759ec4041d8c53d365b690b0782ea8b03.zip
Support <system-sdk> in fwk manifest and dev matrix.
<system-sdk> is a tag in framework manifest and device matrix. It states a list of System SDK levels that the framework supports for vendor apps / vendor apps requires. Format: <system-sdk> <version>14</version> <version>15</version> </system-sdk> Versions must not be duplicated. It is compatible when the set specified in framework manifest is a superset of the set specified in the device compatibility matrix. Test: libvintf_test Test: vintf_object_tests Bug: 69088799 Change-Id: I802f055ea60666995202438a770d1e440517ec5c
Diffstat (limited to 'parse_xml.cpp')
-rw-r--r--parse_xml.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 62ba763..74ba880 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -741,6 +741,20 @@ struct VendorNdkConverter : public XmlNodeConverter<VendorNdk> {
741 741
742const VendorNdkConverter vendorNdkConverter{}; 742const VendorNdkConverter vendorNdkConverter{};
743 743
744const XmlTextConverter<std::string> systemSdkVersionConverter{"version"};
745
746struct SystemSdkConverter : public XmlNodeConverter<SystemSdk> {
747 std::string elementName() const override { return "system-sdk"; }
748 void mutateNode(const SystemSdk& object, NodeType* root, DocType* d) const override {
749 appendChildren(root, systemSdkVersionConverter, object.versions(), d);
750 }
751 bool buildObject(SystemSdk* object, NodeType* root) const override {
752 return parseChildren(root, systemSdkVersionConverter, &object->mVersions);
753 }
754};
755
756const SystemSdkConverter systemSdkConverter{};
757
744struct HalManifestSepolicyConverter : public XmlNodeConverter<Version> { 758struct HalManifestSepolicyConverter : public XmlNodeConverter<Version> {
745 std::string elementName() const override { return "sepolicy"; } 759 std::string elementName() const override { return "sepolicy"; }
746 void mutateNode(const Version &m, NodeType *root, DocType *d) const override { 760 void mutateNode(const Version &m, NodeType *root, DocType *d) const override {
@@ -801,6 +815,11 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
801 815
802 appendChildren(root, vendorNdkConverter, m.framework.mVendorNdks, d); 816 appendChildren(root, vendorNdkConverter, m.framework.mVendorNdks, d);
803 } 817 }
818 if (!(flags & SerializeFlag::NO_SSDK)) {
819 if (!m.framework.mSystemSdk.empty()) {
820 appendChild(root, systemSdkConverter(m.framework.mSystemSdk, d));
821 }
822 }
804 } 823 }
805 824
806 if (!(flags & SerializeFlag::NO_XMLFILES)) { 825 if (!(flags & SerializeFlag::NO_XMLFILES)) {
@@ -846,6 +865,10 @@ struct HalManifestConverter : public XmlNodeConverter<HalManifest> {
846 if (!parseChildren(root, vendorNdkConverter, &object->framework.mVendorNdks)) { 865 if (!parseChildren(root, vendorNdkConverter, &object->framework.mVendorNdks)) {
847 return false; 866 return false;
848 } 867 }
868
869 if (!parseOptionalChild(root, systemSdkConverter, {}, &object->framework.mSystemSdk)) {
870 return false;
871 }
849 } 872 }
850 for (auto &&hal : hals) { 873 for (auto &&hal : hals) {
851 std::string description{hal.name}; 874 std::string description{hal.name};
@@ -949,6 +972,12 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
949 appendChild(root, vendorNdkConverter(m.device.mVendorNdk, d)); 972 appendChild(root, vendorNdkConverter(m.device.mVendorNdk, d));
950 } 973 }
951 } 974 }
975
976 if (!(flags & SerializeFlag::NO_SSDK)) {
977 if (!m.device.mSystemSdk.empty()) {
978 appendChild(root, systemSdkConverter(m.device.mSystemSdk, d));
979 }
980 }
952 } 981 }
953 982
954 if (!(flags & SerializeFlag::NO_XMLFILES)) { 983 if (!(flags & SerializeFlag::NO_XMLFILES)) {
@@ -1000,6 +1029,10 @@ struct CompatibilityMatrixConverter : public XmlNodeConverter<CompatibilityMatri
1000 if (!parseOptionalChild(root, vendorNdkConverter, {}, &object->device.mVendorNdk)) { 1029 if (!parseOptionalChild(root, vendorNdkConverter, {}, &object->device.mVendorNdk)) {
1001 return false; 1030 return false;
1002 } 1031 }
1032
1033 if (!parseOptionalChild(root, systemSdkConverter, {}, &object->device.mSystemSdk)) {
1034 return false;
1035 }
1003 } 1036 }
1004 1037
1005 if (!kMetaVersion.minorAtLeast(version)) { 1038 if (!kMetaVersion.minorAtLeast(version)) {