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

Commit b56865ee authored by Inseob Kim's avatar Inseob Kim Committed by Automerger Merge Worker
Browse files

Create only one vendor variant depending on path am: 85708802

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1324102

Change-Id: I5526061c26e2949b8894eafa5df85014de0a229d
parents d05c43a1 85708802
Loading
Loading
Loading
Loading
+20 −8
Original line number Diff line number Diff line
@@ -3088,20 +3088,32 @@ func (m *Module) ImageMutatorBegin(mctx android.BaseModuleContext) {
		// This will be available in /system, /vendor and /product
		// or a /system directory that is available to vendor and product.
		coreVariantNeeded = true

		// We assume that modules under proprietary paths are compatible for
		// BOARD_VNDK_VERSION. The other modules are regarded as AOSP, or
		// PLATFORM_VNDK_VERSION.
		if isVendorProprietaryPath(mctx.ModuleDir()) {
			vendorVariants = append(vendorVariants, boardVndkVersion)
		} else {
			vendorVariants = append(vendorVariants, platformVndkVersion)
		productVariants = append(productVariants, platformVndkVersion)
		// VNDK modules must not create BOARD_VNDK_VERSION variant because its
		// code is PLATFORM_VNDK_VERSION.
		// On the other hand, vendor_available modules which are not VNDK should
		// also build BOARD_VNDK_VERSION because it's installed in /vendor.
		}

		// vendor_available modules are also available to /product.
		productVariants = append(productVariants, platformVndkVersion)
		// VNDK is always PLATFORM_VNDK_VERSION
		if !m.IsVndk() {
			vendorVariants = append(vendorVariants, boardVndkVersion)
			productVariants = append(productVariants, productVndkVersion)
		}
	} else if vendorSpecific && String(m.Properties.Sdk_version) == "" {
		// This will be available in /vendor (or /odm) only
		// We assume that modules under proprietary paths are compatible for
		// BOARD_VNDK_VERSION. The other modules are regarded as AOSP, or
		// PLATFORM_VNDK_VERSION.
		if isVendorProprietaryPath(mctx.ModuleDir()) {
			vendorVariants = append(vendorVariants, boardVndkVersion)
		} else {
			vendorVariants = append(vendorVariants, platformVndkVersion)
		}
	} else {
		// This is either in /system (or similar: /data), or is a
		// modules built with the NDK. Modules built with the NDK
+8 −2
Original line number Diff line number Diff line
@@ -79,8 +79,14 @@ func (g *GenruleExtraProperties) ExtraImageVariations(ctx android.BaseModuleCont

	var variants []string
	if Bool(g.Vendor_available) || ctx.SocSpecific() || ctx.DeviceSpecific() {
		vndkVersion := ctx.DeviceConfig().VndkVersion()
		// If vndkVersion is current, we can always use PlatformVndkVersion.
		// If not, we assume modules under proprietary paths are compatible for
		// BOARD_VNDK_VERSION. The other modules are regarded as AOSP, that is
		// PLATFORM_VNDK_VERSION.
		if vndkVersion == "current" || !isVendorProprietaryPath(ctx.ModuleDir()) {
			variants = append(variants, VendorVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
		if vndkVersion := ctx.DeviceConfig().VndkVersion(); vndkVersion != "current" {
		} else {
			variants = append(variants, VendorVariationPrefix+vndkVersion)
		}
	}