Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ab86600 authored by Bill Yang's avatar Bill Yang
Browse files

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
parent 3ab5fcd2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2250,3 +2250,11 @@ func (c *config) SystemManifestFile() []string {
func (c *config) SystemExtManifestFiles() []string {
	return c.productVariables.SystemExtManifestFiles
}

func (c *config) DeviceManifestFiles() []string {
	return c.productVariables.DeviceManifestFiles
}

func (c *config) OdmManifestFiles() []string {
	return c.productVariables.OdmManifestFiles
}
+2 −0
Original line number Diff line number Diff line
@@ -540,6 +540,8 @@ type ProductVariables struct {
	ProductManifestFiles   []string `json:",omitempty"`
	SystemManifestFile     []string `json:",omitempty"`
	SystemExtManifestFiles []string `json:",omitempty"`
	DeviceManifestFiles    []string `json:",omitempty"`
	OdmManifestFiles       []string `json:",omitempty"`
}

type PartitionQualifiedVariablesType struct {
+23 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ const (
	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 @@ func (m *vintfDataRule) GenerateAndroidBuildActions(ctx ModuleContext) {
		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()))
	}