Disable AVB check by default.
am: dfae6942c0
Change-Id: I093697f79a02de0b57f0bf16c946a72692ff68ec
diff --git a/include/vintf/CheckFlags.h b/include/vintf/CheckFlags.h
index d63a809..2da807c 100644
--- a/include/vintf/CheckFlags.h
+++ b/include/vintf/CheckFlags.h
@@ -48,6 +48,9 @@
// Disable RuntimeInfo <-> Framework Matrix check. This implies DISABLE_AVB_CHECK.
constexpr Type DISABLE_RUNTIME_INFO = ENABLE_ALL_CHECKS.disableRuntimeInfo();
+// Default flag if no flag is provided.
+constexpr Type DEFAULT = DISABLE_AVB_CHECK;
+
// tests
static_assert(ENABLE_ALL_CHECKS.isAvbEnabled(), "");
static_assert(ENABLE_ALL_CHECKS.isRuntimeInfoEnabled(), "");
diff --git a/include/vintf/RuntimeInfo.h b/include/vintf/RuntimeInfo.h
index c48942e..2e04279 100644
--- a/include/vintf/RuntimeInfo.h
+++ b/include/vintf/RuntimeInfo.h
@@ -73,7 +73,7 @@
// not when RuntimeInfo::checkCompatibility is called.
// - avb-vbmetaversion matches related sysprops
bool checkCompatibility(const CompatibilityMatrix& mat, std::string* error = nullptr,
- CheckFlags::Type flags = CheckFlags::ENABLE_ALL_CHECKS) const;
+ CheckFlags::Type flags = CheckFlags::DEFAULT) const;
using FetchFlags = uint32_t;
enum FetchFlag : FetchFlags {
diff --git a/include/vintf/VintfObject.h b/include/vintf/VintfObject.h
index e1a4501..ceabf61 100644
--- a/include/vintf/VintfObject.h
+++ b/include/vintf/VintfObject.h
@@ -137,7 +137,7 @@
* < 0 if any error (mount partition fails, illformed XML, etc.)
*/
int32_t checkCompatibility(std::string* error = nullptr,
- CheckFlags::Type flags = CheckFlags::ENABLE_ALL_CHECKS);
+ CheckFlags::Type flags = CheckFlags::DEFAULT);
/**
* A std::function that abstracts a list of "provided" instance names. Given package, version
@@ -273,7 +273,7 @@
*/
static int32_t CheckCompatibility(const std::vector<std::string>& packageInfo,
std::string* error = nullptr,
- CheckFlags::Type flags = CheckFlags::ENABLE_ALL_CHECKS);
+ CheckFlags::Type flags = CheckFlags::DEFAULT);
/**
* Check deprecation on framework matrices with a provided predicate.
@@ -320,7 +320,7 @@
// Helper to CheckCompatibility with dependency injection.
int32_t checkCompatibility(const std::vector<std::string>& packageInfo,
std::string* error = nullptr,
- CheckFlags::Type flags = CheckFlags::ENABLE_ALL_CHECKS);
+ CheckFlags::Type flags = CheckFlags::DEFAULT);
static bool IsHalDeprecated(const MatrixHal& oldMatrixHal,
const CompatibilityMatrix& targetMatrix,
diff --git a/test/LibVintfTest.cpp b/test/LibVintfTest.cpp
index a3a98b8..49a3a84 100644
--- a/test/LibVintfTest.cpp
+++ b/test/LibVintfTest.cpp
@@ -886,20 +886,20 @@
CompatibilityMatrix cm = testMatrix(MatrixKernel(KernelVersion{3, 18, 31}, {}));
{
setAvb(badAvb, {1, 0}, {2, 1});
- EXPECT_FALSE(badAvb.checkCompatibility(cm, &error));
+ EXPECT_FALSE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS));
EXPECT_STREQ(error.c_str(), "Vbmeta version 1.0 does not match framework matrix 2.1");
}
{
setAvb(badAvb, {2, 1}, {3, 0});
- EXPECT_FALSE(badAvb.checkCompatibility(cm, &error));
+ EXPECT_FALSE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS));
}
{
setAvb(badAvb, {2, 1}, {2, 3});
- EXPECT_TRUE(badAvb.checkCompatibility(cm, &error));
+ EXPECT_TRUE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS));
}
{
setAvb(badAvb, {2, 3}, {2, 1});
- EXPECT_TRUE(badAvb.checkCompatibility(cm, &error));
+ EXPECT_TRUE(badAvb.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS));
}
}
@@ -933,7 +933,7 @@
EXPECT_TRUE(gCompatibilityMatrixConverter(&cm, xml));
RuntimeInfo ki = testRuntimeInfo();
std::string error;
- EXPECT_FALSE(ki.checkCompatibility(cm, &error));
+ EXPECT_FALSE(ki.checkCompatibility(cm, &error, CheckFlags::ENABLE_ALL_CHECKS));
EXPECT_STREQ(error.c_str(), "AVB version 2.1 does not match framework matrix 1.0");
EXPECT_TRUE(ki.checkCompatibility(cm, &error, CheckFlags::DISABLE_AVB_CHECK)) << error;
}