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

Commit 5cfbfbb6 authored by Jaekyun Seok's avatar Jaekyun Seok
Browse files

Use product instead of oem for Product specific module

Bug: 64195575
Test: succeeded building product.img with BOARD_PRODUCTIMAGE_PARTITION_SIZE,
BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE and PRODUCT_PRODUCT_VERITY_PARTITION.
Change-Id: Icc4f8c16bc389fe20db680849f311d02df1299c3
parent fdc2b3be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ func translateAndroidMkModule(ctx SingletonContext, w io.Writer, mod blueprint.M
			fmt.Fprintln(&data.preamble, "LOCAL_ODM_MODULE := true")
		}
		if Bool(amod.commonProperties.Product_specific) {
			fmt.Fprintln(&data.preamble, "LOCAL_OEM_MODULE := true")
			fmt.Fprintln(&data.preamble, "LOCAL_PRODUCT_MODULE := true")
		}
		if amod.commonProperties.Owner != nil {
			fmt.Fprintln(&data.preamble, "LOCAL_MODULE_OWNER :=", *amod.commonProperties.Owner)
+4 −4
Original line number Diff line number Diff line
@@ -676,11 +676,11 @@ func (c *deviceConfig) OdmPath() string {
	return "odm"
}

func (c *deviceConfig) OemPath() string {
	if c.config.ProductVariables.OemPath != nil {
		return *c.config.ProductVariables.OemPath
func (c *deviceConfig) ProductPath() string {
	if c.config.ProductVariables.ProductPath != nil {
		return *c.config.ProductVariables.ProductPath
	}
	return "oem"
	return "product"
}

func (c *deviceConfig) BtConfigIncludeDir() string {
+2 −2
Original line number Diff line number Diff line
@@ -232,8 +232,8 @@ type commonProperties struct {
	Device_specific *bool

	// whether this module is specific to a software configuration of a product (e.g. country,
	// network operator, etc). When set to true, it is installed into /oem (or /system/oem if
	// oem partition does not exist).
	// network operator, etc). When set to true, it is installed into /product (or
	// /system/product if product partition does not exist).
	Product_specific *bool

	// init.rc files to be installed if this module is installed
+1 −1
Original line number Diff line number Diff line
@@ -850,7 +850,7 @@ func PathForModuleInstall(ctx ModuleInstallPathContext, pathComponents ...string
		} else if ctx.DeviceSpecific() {
			partition = ctx.DeviceConfig().OdmPath()
		} else if ctx.ProductSpecific() {
			partition = ctx.DeviceConfig().OemPath()
			partition = ctx.DeviceConfig().ProductPath()
		} else {
			partition = "system"
		}
+6 −6
Original line number Diff line number Diff line
@@ -264,7 +264,7 @@ func TestPathForModuleInstall(t *testing.T) {
			out: "target/product/test_device/odm/bin/my_test",
		},
		{
			name: "oem binary",
			name: "product binary",
			ctx: &moduleInstallPathContextImpl{
				androidBaseContextImpl: androidBaseContextImpl{
					target: deviceTarget,
@@ -272,7 +272,7 @@ func TestPathForModuleInstall(t *testing.T) {
				},
			},
			in:  []string{"bin", "my_test"},
			out: "target/product/test_device/oem/bin/my_test",
			out: "target/product/test_device/product/bin/my_test",
		},

		{
@@ -311,7 +311,7 @@ func TestPathForModuleInstall(t *testing.T) {
			out: "target/product/test_device/data/nativetest/my_test",
		},
		{
			name: "oem native test binary",
			name: "product native test binary",
			ctx: &moduleInstallPathContextImpl{
				androidBaseContextImpl: androidBaseContextImpl{
					target: deviceTarget,
@@ -359,7 +359,7 @@ func TestPathForModuleInstall(t *testing.T) {
			out: "target/product/test_device/data/asan/odm/bin/my_test",
		},
		{
			name: "sanitized oem binary",
			name: "sanitized product binary",
			ctx: &moduleInstallPathContextImpl{
				androidBaseContextImpl: androidBaseContextImpl{
					target: deviceTarget,
@@ -368,7 +368,7 @@ func TestPathForModuleInstall(t *testing.T) {
				inSanitizerDir: true,
			},
			in:  []string{"bin", "my_test"},
			out: "target/product/test_device/data/asan/oem/bin/my_test",
			out: "target/product/test_device/data/asan/product/bin/my_test",
		},

		{
@@ -410,7 +410,7 @@ func TestPathForModuleInstall(t *testing.T) {
			out: "target/product/test_device/data/asan/data/nativetest/my_test",
		},
		{
			name: "sanitized oem native test binary",
			name: "sanitized product native test binary",
			ctx: &moduleInstallPathContextImpl{
				androidBaseContextImpl: androidBaseContextImpl{
					target: deviceTarget,
Loading