Generate product variants by default

PRODUCT_PRODUCT_VNDK_VERSION is set to 'current' by default. Now, we
can generate product variants without checking the
PRODUCT_PRODUCT_VNDK_VERSION build variable. Remove reading the
PRODUCT_PRODUCT_VNDK_VERSION variable from soong and generate product
variants by default.

Bug: 302255959
Test: m
Change-Id: I9a9b2076f4367c5ce9a393bbb206f8dee3884bd8
This commit is contained in:
Justin Yun
2023-09-27 16:22:10 +09:00
parent c5b9abba30
commit af1fde43f9
11 changed files with 32 additions and 235 deletions

View File

@@ -427,7 +427,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
platformVndkVersion := mctx.DeviceConfig().PlatformVndkVersion()
boardVndkVersion := mctx.DeviceConfig().VndkVersion()
productVndkVersion := mctx.DeviceConfig().ProductVndkVersion()
recoverySnapshotVersion := mctx.DeviceConfig().RecoverySnapshotVersion()
usingRecoverySnapshot := recoverySnapshotVersion != "current" &&
recoverySnapshotVersion != ""
@@ -444,9 +443,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
if boardVndkVersion == "current" {
boardVndkVersion = platformVndkVersion
}
if productVndkVersion == "current" {
productVndkVersion = platformVndkVersion
}
if m.NeedsLlndkVariants() {
// This is an LLNDK library. The implementation of the library will be on /system,
@@ -462,9 +458,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
if needVndkVersionVendorVariantForLlndk {
vendorVariants = append(vendorVariants, boardVndkVersion)
}
if productVndkVersion != "" {
productVariants = append(productVariants, productVndkVersion)
}
} else if m.NeedsVendorPublicLibraryVariants() {
// A vendor public library has the implementation on /vendor, with stub variants
// for system and product.
@@ -473,9 +466,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
if platformVndkVersion != "" {
productVariants = append(productVariants, platformVndkVersion)
}
if productVndkVersion != "" {
productVariants = append(productVariants, productVndkVersion)
}
} else if boardVndkVersion == "" {
// If the device isn't compiling against the VNDK, we always
// use the core mode.
@@ -507,10 +497,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
// product_available modules are available to /product.
if m.HasProductVariant() {
productVariants = append(productVariants, platformVndkVersion)
// VNDK is always PLATFORM_VNDK_VERSION
if !m.IsVndk() {
productVariants = append(productVariants, productVndkVersion)
}
}
} else if vendorSpecific && m.SdkVersion() == "" {
// This will be available in /vendor (or /odm) only
@@ -538,17 +524,10 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
coreVariantNeeded = true
}
if boardVndkVersion != "" && productVndkVersion != "" {
if coreVariantNeeded && productSpecific && m.SdkVersion() == "" {
// The module has "product_specific: true" that does not create core variant.
coreVariantNeeded = false
productVariants = append(productVariants, productVndkVersion)
}
} else {
// Unless PRODUCT_PRODUCT_VNDK_VERSION is set, product partition has no
// restriction to use system libs.
// No product variants defined in this case.
productVariants = []string{}
if coreVariantNeeded && productSpecific && m.SdkVersion() == "" {
// The module has "product_specific: true" that does not create core variant.
coreVariantNeeded = false
productVariants = append(productVariants, platformVndkVersion)
}
if m.RamdiskAvailable() {