assemble_vintf: skip kernel check if --no-kernel-requirements

Previously, if --no-kernel-requirements is specified,
<kernel> tag won't present in the HAL manifest, therefore kernel
requirements are not enforced.

Now, <kernel> tag is always present in the HAL manifest (for kernel
FCM version). Properly skip kernel check when --no-kernel-requirements
are specified.

Fixes: 146180227
Test: libvintf_test
Test: vintf_object_test
Change-Id: I94efa746609a39dec7d470ff881cf8a5fd9b1d83
diff --git a/AssembleVintf.cpp b/AssembleVintf.cpp
index bf9d530..1dec7ec 100644
--- a/AssembleVintf.cpp
+++ b/AssembleVintf.cpp
@@ -260,7 +260,7 @@
     bool checkDualFile(const HalManifest& manifest, const CompatibilityMatrix& matrix) {
         if (getBooleanFlag("PRODUCT_ENFORCE_VINTF_MANIFEST")) {
             std::string error;
-            if (!manifest.checkCompatibility(matrix, &error)) {
+            if (!manifest.checkCompatibility(matrix, &error, mCheckFlags)) {
                 std::cerr << "Not compatible: " << error << std::endl;
                 return false;
             }
@@ -411,7 +411,7 @@
 
         if (mOutputMatrix) {
             CompatibilityMatrix generatedMatrix = halManifest->generateCompatibleMatrix();
-            if (!halManifest->checkCompatibility(generatedMatrix, &error)) {
+            if (!halManifest->checkCompatibility(generatedMatrix, &error, mCheckFlags)) {
                 std::cerr << "FATAL ERROR: cannot generate a compatible matrix: " << error
                           << std::endl;
             }
@@ -749,6 +749,7 @@
 
     bool setNoKernelRequirements() override {
         mSerializeFlags = mSerializeFlags.disableKernelConfigs().disableKernelMinorRevision();
+        mCheckFlags = mCheckFlags.disableKernel();
         return true;
     }
 
@@ -761,6 +762,7 @@
     SerializeFlags::Type mSerializeFlags = SerializeFlags::EVERYTHING;
     std::map<KernelVersion, std::vector<NamedIstream>> mKernels;
     std::map<std::string, std::string> mFakeEnv;
+    CheckFlags::Type mCheckFlags = CheckFlags::DEFAULT;
 };
 
 bool AssembleVintf::openOutFile(const std::string& path) {