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

Commit a889167f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add *_dlkm properties to android.ModuleBase" into main

parents 084877aa 27ff7679
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -81,6 +81,9 @@ type Module interface {
	InstallInProduct() bool
	InstallInVendor() bool
	InstallInSystemExt() bool
	InstallInSystemDlkm() bool
	InstallInVendorDlkm() bool
	InstallInOdmDlkm() bool
	InstallForceOS() (*OsType, *ArchType)
	PartitionTag(DeviceConfig) string
	HideFromMake()
@@ -386,6 +389,15 @@ type commonProperties struct {
	// Whether this module is installed to debug ramdisk
	Debug_ramdisk *bool

	// Install to partition system_dlkm when set to true.
	System_dlkm_specific *bool

	// Install to partition vendor_dlkm when set to true.
	Vendor_dlkm_specific *bool

	// Install to partition odm_dlkm when set to true.
	Odm_dlkm_specific *bool

	// Whether this module is built for non-native architectures (also known as native bridge binary)
	Native_bridge_supported *bool `android:"arch_variant"`

@@ -1535,6 +1547,18 @@ func (m *ModuleBase) InstallInRoot() bool {
	return false
}

func (m *ModuleBase) InstallInSystemDlkm() bool {
	return Bool(m.commonProperties.System_dlkm_specific)
}

func (m *ModuleBase) InstallInVendorDlkm() bool {
	return Bool(m.commonProperties.Vendor_dlkm_specific)
}

func (m *ModuleBase) InstallInOdmDlkm() bool {
	return Bool(m.commonProperties.Odm_dlkm_specific)
}

func (m *ModuleBase) InstallForceOS() (*OsType, *ArchType) {
	return nil, nil
}
+15 −0
Original line number Diff line number Diff line
@@ -196,6 +196,9 @@ type ModuleContext interface {
	InstallInOdm() bool
	InstallInProduct() bool
	InstallInVendor() bool
	InstallInSystemDlkm() bool
	InstallInVendorDlkm() bool
	InstallInOdmDlkm() bool
	InstallForceOS() (*OsType, *ArchType)

	RequiredModuleNames(ctx ConfigurableEvaluatorContext) []string
@@ -493,6 +496,18 @@ func (m *moduleContext) InstallInVendor() bool {
	return m.module.InstallInVendor()
}

func (m *moduleContext) InstallInSystemDlkm() bool {
	return m.module.InstallInSystemDlkm()
}

func (m *moduleContext) InstallInVendorDlkm() bool {
	return m.module.InstallInVendorDlkm()
}

func (m *moduleContext) InstallInOdmDlkm() bool {
	return m.module.InstallInOdmDlkm()
}

func (m *moduleContext) skipInstall() bool {
	if m.module.base().commonProperties.SkipInstall {
		return true
+12 −0
Original line number Diff line number Diff line
@@ -106,6 +106,18 @@ func (m ModuleProxy) InstallInSystemExt() bool {
	panic("method is not implemented on ModuleProxy")
}

func (m ModuleProxy) InstallInSystemDlkm() bool {
	panic("method is not implemented on ModuleProxy")
}

func (m ModuleProxy) InstallInVendorDlkm() bool {
	panic("method is not implemented on ModuleProxy")
}

func (m ModuleProxy) InstallInOdmDlkm() bool {
	panic("method is not implemented on ModuleProxy")
}

func (m ModuleProxy) InstallForceOS() (*OsType, *ArchType) {
	panic("method is not implemented on ModuleProxy")
}
+36 −0
Original line number Diff line number Diff line
@@ -117,6 +117,9 @@ type ModuleInstallPathContext interface {
	InstallInOdm() bool
	InstallInProduct() bool
	InstallInVendor() bool
	InstallInSystemDlkm() bool
	InstallInVendorDlkm() bool
	InstallInOdmDlkm() bool
	InstallForceOS() (*OsType, *ArchType)
}

@@ -170,6 +173,18 @@ func (ctx *baseModuleContextToModuleInstallPathContext) InstallInVendor() bool {
	return ctx.Module().InstallInVendor()
}

func (ctx *baseModuleContextToModuleInstallPathContext) InstallInSystemDlkm() bool {
	return ctx.Module().InstallInSystemDlkm()
}

func (ctx *baseModuleContextToModuleInstallPathContext) InstallInVendorDlkm() bool {
	return ctx.Module().InstallInVendorDlkm()
}

func (ctx *baseModuleContextToModuleInstallPathContext) InstallInOdmDlkm() bool {
	return ctx.Module().InstallInOdmDlkm()
}

func (ctx *baseModuleContextToModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) {
	return ctx.Module().InstallForceOS()
}
@@ -2131,6 +2146,12 @@ func modulePartition(ctx ModuleInstallPathContext, device bool) string {
			partition = ctx.DeviceConfig().SystemExtPath()
		} else if ctx.InstallInRoot() {
			partition = "root"
		} else if ctx.InstallInSystemDlkm() {
			partition = ctx.DeviceConfig().SystemDlkmPath()
		} else if ctx.InstallInVendorDlkm() {
			partition = ctx.DeviceConfig().VendorDlkmPath()
		} else if ctx.InstallInOdmDlkm() {
			partition = ctx.DeviceConfig().OdmDlkmPath()
		} else {
			partition = "system"
		}
@@ -2334,6 +2355,9 @@ type testModuleInstallPathContext struct {
	inOdm           bool
	inProduct       bool
	inVendor        bool
	inSystemDlkm    bool
	inVendorDlkm    bool
	inOdmDlkm       bool
	forceOS         *OsType
	forceArch       *ArchType
}
@@ -2388,6 +2412,18 @@ func (m testModuleInstallPathContext) InstallInVendor() bool {
	return m.inVendor
}

func (m testModuleInstallPathContext) InstallInSystemDlkm() bool {
	return m.inSystemDlkm
}

func (m testModuleInstallPathContext) InstallInVendorDlkm() bool {
	return m.inVendorDlkm
}

func (m testModuleInstallPathContext) InstallInOdmDlkm() bool {
	return m.inOdmDlkm
}

func (m testModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) {
	return m.forceOS, m.forceArch
}
+1 −16
Original line number Diff line number Diff line
@@ -137,15 +137,6 @@ type prebuiltEtcProperties struct {
	// Install symlinks to the installed file.
	Symlinks []string `android:"arch_variant"`

	// Install to partition system_dlkm when set to true.
	System_dlkm_specific *bool `android:"arch_variant"`

	// Install to partition vendor_dlkm when set to true.
	Vendor_dlkm_specific *bool `android:"arch_variant"`

	// Install to partition odm_dlkm when set to true.
	Odm_dlkm_specific *bool `android:"arch_variant"`

	// Install to partition oem when set to true.
	Oem_specific *bool `android:"arch_variant"`
}
@@ -386,13 +377,7 @@ func (p *PrebuiltEtc) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	}
	baseInstallDirPath := android.PathForModuleInstall(ctx, p.installBaseDir(ctx), p.SubDir())
	// TODO(b/377304441)
	if android.Bool(p.properties.System_dlkm_specific) {
		baseInstallDirPath = android.PathForModuleInPartitionInstall(ctx, ctx.DeviceConfig().SystemDlkmPath(), p.installBaseDir(ctx), p.SubDir())
	} else if android.Bool(p.properties.Vendor_dlkm_specific) {
		baseInstallDirPath = android.PathForModuleInPartitionInstall(ctx, ctx.DeviceConfig().VendorDlkmPath(), p.installBaseDir(ctx), p.SubDir())
	} else if android.Bool(p.properties.Odm_dlkm_specific) {
		baseInstallDirPath = android.PathForModuleInPartitionInstall(ctx, ctx.DeviceConfig().OdmDlkmPath(), p.installBaseDir(ctx), p.SubDir())
	} else if android.Bool(p.properties.Oem_specific) {
	if android.Bool(p.properties.Oem_specific) {
		baseInstallDirPath = android.PathForModuleInPartitionInstall(ctx, ctx.DeviceConfig().OemPath(), p.installBaseDir(ctx), p.SubDir())
	}