AssembleVintf: kernel requirement per FCM version

Devices with different Shipping FCM Version has
different kernel requirements

Test: libvintf_test
Test: build matrix with different Shipping FCM version
      in manifest.

Bug: 72389707
Change-Id: I573fe44ac7108026823aeed88438b55e13e75d7f
diff --git a/CompatibilityMatrix.cpp b/CompatibilityMatrix.cpp
index d3c4ebf..56cd0e8 100644
--- a/CompatibilityMatrix.cpp
+++ b/CompatibilityMatrix.cpp
@@ -290,6 +290,22 @@
         }
     }
 
+    for (auto& e : *matrices) {
+        if (&e.object != matrix && e.object.level() == deviceLevel &&
+            e.object.type() == SchemaType::FRAMEWORK) {
+            for (MatrixKernel& kernel : e.object.framework.mKernels) {
+                KernelVersion ver = kernel.minLts();
+                if (!matrix->add(std::move(kernel))) {
+                    if (error) {
+                        *error = "Cannot add kernel version " + to_string(ver) +
+                                 " from FCM version " + to_string(deviceLevel);
+                    }
+                    return nullptr;
+                }
+            }
+        }
+    }
+
     return matrix;
 }