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

Commit af1fde43 authored by Justin Yun's avatar Justin Yun
Browse files

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
parent c5b9abba
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -1434,10 +1434,6 @@ func (c *deviceConfig) PlatformVndkVersion() string {
	return String(c.config.productVariables.Platform_vndk_version)
}

func (c *deviceConfig) ProductVndkVersion() string {
	return String(c.config.productVariables.ProductVndkVersion)
}

func (c *deviceConfig) ExtraVndkVersions() []string {
	return c.config.productVariables.ExtraVndkVersions
}
+0 −2
Original line number Diff line number Diff line
@@ -418,8 +418,6 @@ type ProductVariables struct {
	ProductPublicSepolicyDirs  []string `json:",omitempty"`
	ProductPrivateSepolicyDirs []string `json:",omitempty"`

	ProductVndkVersion *string `json:",omitempty"`

	TargetFSConfigGen []string `json:",omitempty"`

	EnforceProductPartitionInterface *bool `json:",omitempty"`
+1 −1
Original line number Diff line number Diff line
@@ -736,7 +736,7 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s
			vndkVersion = deviceConfig.VndkVersion()
		} else if a.ProductSpecific() {
			prefix = cc.ProductVariationPrefix
			vndkVersion = deviceConfig.ProductVndkVersion()
			vndkVersion = deviceConfig.PlatformVndkVersion()
		}
	}
	if vndkVersion == "current" {
+2 −4
Original line number Diff line number Diff line
@@ -3088,10 +3088,7 @@ func TestProductVariant(t *testing.T) {
			apex_available: ["myapex"],
			srcs: ["foo.cpp"],
		}
	`, android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
		variables.ProductVndkVersion = proptools.StringPtr("current")
	}),
	)
	`)

	cflags := strings.Fields(
		ctx.ModuleForTests("foo", "android_product.29_arm64_armv8-a_myapex").Rule("cc").Args["cFlags"])
@@ -10521,6 +10518,7 @@ func TestTrimmedApex(t *testing.T) {
			min_sdk_version: "29",
			recovery_available: true,
			vendor_available: true,
			product_available: true,
		}
		api_imports {
			name: "api_imports",
+1 −6
Original line number Diff line number Diff line
@@ -115,12 +115,7 @@ func TestVndkApexUsesVendorVariant(t *testing.T) {
	})

	t.Run("VNDK APEX gathers only vendor variants even if product variants are available", func(t *testing.T) {
		ctx := testApex(t, bp,
			android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
				// Now product variant is available
				variables.ProductVndkVersion = proptools.StringPtr("current")
			}),
		)
		ctx := testApex(t, bp)

		files := getFiles(t, ctx, "com.android.vndk.current", "android_common")
		ensureFileSrc(t, files, "lib/libfoo.so", "libfoo/android_vendor.29_arm_armv7-a-neon_shared/libfoo.so")
Loading