Also consider kernelLevel when combining FCMs.
If VintfObject::getKernelLevel() returns a level less than
target FCM (device manifest level), then CompatibilityMatrix::combine
did not include kernel requirements from older FCM.
Fix this by passing the kernel level to CompatibiltiyMatrix::combine,
so that old kernel requirements are also included.
Test: libvintf_test
Test: vintf_object_test
Fixes: 188939851
Change-Id: Ib57e8bd03046a07e3a86f21aaafe4aabc5e72710
diff --git a/AssembleVintf.cpp b/AssembleVintf.cpp
index 81ac234..cf427dc 100644
--- a/AssembleVintf.cpp
+++ b/AssembleVintf.cpp
@@ -568,7 +568,9 @@
<< std::endl;
}
}
- builtMatrix = CompatibilityMatrix::combine(deviceLevel, matrices, &error);
+ // No <kernel> tags to assemble at this point
+ const auto kernelLevel = Level::UNSPECIFIED;
+ builtMatrix = CompatibilityMatrix::combine(deviceLevel, kernelLevel, matrices, &error);
matrix = builtMatrix.get();
if (matrix == nullptr) {