Allow to disable certain checks in VintfObject::CheckCompatibility
Allow to disable AVB version checks.
Test: builds
Test: vintf_object_test
Test: libvintf_test
Bug: 38325029
Bug: 65270190
Change-Id: Iadc2408f635a5487a5af4e19f516147930f4bc4b
Merged-In: Iadc2408f635a5487a5af4e19f516147930f4bc4b
diff --git a/VintfObject.cpp b/VintfObject.cpp
index 0f590b6..92fa0b0 100644
--- a/VintfObject.cpp
+++ b/VintfObject.cpp
@@ -171,9 +171,9 @@
// Checks given compatibility info against info on the device. If no
// compatability info is given then the device info will be checked against
// itself.
-int32_t checkCompatibility(const std::vector<std::string> &xmls, bool mount,
- const PartitionMounter &mounter, std::string *error) {
-
+int32_t checkCompatibility(const std::vector<std::string>& xmls, bool mount,
+ const PartitionMounter& mounter, std::string* error,
+ DisabledChecks disabledChecks) {
status_t status;
ParseStatus parseStatus;
PackageInfo pkg; // All information from package.
@@ -276,7 +276,7 @@
}
}
if (updated.runtimeInfo && updated.fwk.matrix) {
- if (!updated.runtimeInfo->checkCompatibility(*updated.fwk.matrix, error)) {
+ if (!updated.runtimeInfo->checkCompatibility(*updated.fwk.matrix, error, disabledChecks)) {
if (error)
error->insert(0, "Runtime info and framework compatibility matrix "
"are incompatible: ");
@@ -290,11 +290,10 @@
} // namespace details
// static
-int32_t VintfObject::CheckCompatibility(
- const std::vector<std::string> &xmls, std::string *error) {
- return details::checkCompatibility(xmls, false /* mount */,
- *details::gPartitionMounter,
- error);
+int32_t VintfObject::CheckCompatibility(const std::vector<std::string>& xmls, std::string* error,
+ DisabledChecks disabledChecks) {
+ return details::checkCompatibility(xmls, false /* mount */, *details::gPartitionMounter, error,
+ disabledChecks);
}