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
diff --git a/AssembleVintf.cpp b/AssembleVintf.cpp
index e19096e..f7f1fb4 100644
--- a/AssembleVintf.cpp
+++ b/AssembleVintf.cpp
@@ -76,6 +76,18 @@
return envValue != nullptr ? std::string(envValue) : std::string();
}
+ // Get environment variable and split with space.
+ std::vector<std::string> getEnvList(const std::string& key) const {
+ std::vector<std::string> ret;
+ for (auto&& v : base::Split(getEnv(key), " ")) {
+ v = base::Trim(v);
+ if (!v.empty()) {
+ ret.push_back(v);
+ }
+ }
+ return ret;
+ }
+
template <typename T>
bool getFlag(const std::string& key, T* value) const {
std::string envValue = getEnv(key);
@@ -290,11 +302,12 @@
}
if (halManifest->mType == SchemaType::FRAMEWORK) {
- for (auto&& v : base::Split(getEnv("PROVIDED_VNDK_VERSIONS"), " ")) {
- v = base::Trim(v);
- if (!v.empty()) {
- halManifest->framework.mVendorNdks.emplace_back(std::move(v));
- }
+ for (auto&& v : getEnvList("PROVIDED_VNDK_VERSIONS")) {
+ halManifest->framework.mVendorNdks.emplace_back(std::move(v));
+ }
+
+ for (auto&& v : getEnvList("PRODUCT_SYSTEMSDK_VERSIONS")) {
+ halManifest->framework.mSystemSdk.mVersions.emplace(std::move(v));
}
}
@@ -416,6 +429,10 @@
}
valueInMatrix = VendorNdk{std::move(vndkVersion)};
}
+
+ for (auto&& v : getEnvList("BOARD_SYSTEMSDK_VERSIONS")) {
+ matrix->device.mSystemSdk.mVersions.emplace(std::move(v));
+ }
}
if (matrices->front().object.mType == SchemaType::FRAMEWORK) {