Proper checks for vendor and ODM SKUs

If DEVICE_MANIFEST_FILE / ODM_MANIFEST_FILES is set, also include check
for empty vendor / odm SKU, respectively. Then, do cross product of
vendor SKUs and ODM skus, and check each possible combination.

Test: build with and without vendor skus
Test: m check-vintf-all
Bug: 148601741

Change-Id: I23cc81998e7afc36c43540bf6d615b4d4b288447
diff --git a/tools/releasetools/check_target_files_vintf.py b/tools/releasetools/check_target_files_vintf.py
index f41df37..24c6dcb 100755
--- a/tools/releasetools/check_target_files_vintf.py
+++ b/tools/releasetools/check_target_files_vintf.py
@@ -67,13 +67,17 @@
 
 
 def GetArgsForSkus(info_dict):
-  skus = info_dict.get('vintf_odm_manifest_skus', '').strip().split()
-  if not skus:
-    logger.info("ODM_MANIFEST_SKUS is not defined. Check once without SKUs.")
-    skus = ['']
-  return [['--property', 'ro.boot.product.hardware.sku=' + sku]
-          for sku in skus]
+  odm_skus = info_dict.get('vintf_odm_manifest_skus', '').strip().split()
+  if info_dict.get('vintf_include_empty_odm_sku', '') == "true":
+    odm_skus += ['']
 
+  vendor_skus = info_dict.get('vintf_vendor_manifest_skus', '').strip().split()
+  if info_dict.get('vintf_include_empty_vendor_sku', '') == "true":
+    vendor_skus += ['']
+
+  return [['--property', 'ro.boot.product.hardware.sku=' + odm_sku,
+           '--property', 'ro.boot.product.vendor.sku=' + vendor_sku]
+          for odm_sku in odm_skus for vendor_sku in vendor_skus]
 
 def GetArgsForShippingApiLevel(info_dict):
   shipping_api_level = info_dict['vendor.build.prop'].get(
@@ -89,7 +93,7 @@
   config_path = os.path.join(input_tmp, 'META/kernel_configs.txt')
 
   if not os.path.isfile(version_path) or not os.path.isfile(config_path):
-    logger.info('Skipping kernel config checks because ' +
+    logger.info('Skipping kernel config checks because '
                 'PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS is not set')
     return []