assemble_vintf supports DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILES

Relax multiple cases that were previously flagged as error
to allow combining matrices that doesn't have a "level"
attribute. Specifically, all HALs in matrices without a specific
FCM version are added as-is.

Test: m framework_compatibility_matrix.xml -j
Test: libvintf_test
Test: vintf_object_test
Bug: 65028233

Change-Id: Ifa947529731ab17d705be945139de504db2d0253
diff --git a/AssembleVintf.cpp b/AssembleVintf.cpp
index 39bdd3a..7f86b94 100644
--- a/AssembleVintf.cpp
+++ b/AssembleVintf.cpp
@@ -368,6 +368,11 @@
     }
 
     bool setDeviceFcmVersion(HalManifest* manifest) {
+        // Not needed for generating empty manifest for DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE.
+        if (getBooleanFlag("IGNORE_TARGET_FCM_VERSION")) {
+            return true;
+        }
+
         size_t shippingApiLevel = getIntegerFlag("PRODUCT_SHIPPING_API_LEVEL");
 
         if (manifest->level() != Level::UNSPECIFIED) {
@@ -457,15 +462,10 @@
                 deviceLevel = getLowestFcmVersion(*matrices);
             }
 
-            if (deviceLevel == Level::UNSPECIFIED) {
-                // building empty.xml
-                matrix = &matrices->front().object;
-            } else {
-                matrix = CompatibilityMatrix::combine(deviceLevel, matrices, &error);
-                if (matrix == nullptr) {
-                    std::cerr << error << std::endl;
-                    return false;
-                }
+            matrix = CompatibilityMatrix::combine(deviceLevel, matrices, &error);
+            if (matrix == nullptr) {
+                std::cerr << error << std::endl;
+                return false;
             }
 
             if (!assembleFrameworkCompatibilityMatrixKernels(matrix)) {