Enhance vintf_data to support vendor_manifest and odm_manifest
Add two new support type "vendor_manifest" and "odm_manifest" for
vintf_data module type.
Bug: 340427295
Test: m vendor_manifest
Change-Id: Ifce5b4c94ea6d5c4ec62584a533315af3d8496fe
diff --git a/android/vintf_data.go b/android/vintf_data.go
index cd5f096..7823397 100644
--- a/android/vintf_data.go
+++ b/android/vintf_data.go
@@ -26,6 +26,8 @@
systemManifestType = "system_manifest"
productManifestType = "product_manifest"
systemExtManifestType = "system_ext_manifest"
+ vendorManifestType = "vendor_manifest"
+ odmManifestType = "odm_manifest"
defaultDcm = "system/libhidl/vintfdata/device_compatibility_matrix.default.xml"
defaultSystemManifest = "system/libhidl/vintfdata/manifest.xml"
@@ -111,6 +113,27 @@
if len(systemExtManifestFiles) > 0 {
inputPaths = append(inputPaths, systemExtManifestFiles...)
}
+ case vendorManifestType:
+ assembleVintfEnvs = append(assembleVintfEnvs, fmt.Sprintf("BOARD_SEPOLICY_VERS=\"%s\"", ctx.DeviceConfig().BoardSepolicyVers()))
+ assembleVintfEnvs = append(assembleVintfEnvs, fmt.Sprintf("PRODUCT_ENFORCE_VINTF_MANIFEST=%t", *ctx.Config().productVariables.Enforce_vintf_manifest))
+ deviceManifestFiles := PathsForSource(ctx, ctx.Config().DeviceManifestFiles())
+ // Only need to generate the manifest if DEVICE_MANIFEST_FILE is defined.
+ if len(deviceManifestFiles) == 0 {
+ m.noAction = true
+ return
+ }
+
+ inputPaths = append(inputPaths, deviceManifestFiles...)
+ case odmManifestType:
+ assembleVintfEnvs = append(assembleVintfEnvs, "VINTF_IGNORE_TARGET_FCM_VERSION=true")
+ odmManifestFiles := PathsForSource(ctx, ctx.Config().OdmManifestFiles())
+ // Only need to generate the manifest if ODM_MANIFEST_FILES is defined.
+ if len(odmManifestFiles) == 0 {
+ m.noAction = true
+ return
+ }
+
+ inputPaths = append(inputPaths, odmManifestFiles...)
default:
panic(fmt.Errorf("For %s: The attribute 'type' value only allowed device_cm, system_manifest, product_manifest, system_ext_manifest!", ctx.Module().Name()))
}