Loading android/module.go +10 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ type Module interface { InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallInOdm() bool InstallInProduct() bool InstallInVendor() bool InstallForceOS() (*OsType, *ArchType) PartitionTag(DeviceConfig) string Loading Loading @@ -1399,6 +1401,14 @@ func (m *ModuleBase) InstallInRecovery() bool { return Bool(m.commonProperties.Recovery) } func (m *ModuleBase) InstallInOdm() bool { return false } func (m *ModuleBase) InstallInProduct() bool { return false } func (m *ModuleBase) InstallInVendor() bool { return Bool(m.commonProperties.Vendor) || Bool(m.commonProperties.Soc_specific) || Bool(m.commonProperties.Proprietary) } Loading android/module_context.go +10 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,8 @@ type ModuleContext interface { InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallInOdm() bool InstallInProduct() bool InstallInVendor() bool InstallForceOS() (*OsType, *ArchType) Loading Loading @@ -438,6 +440,14 @@ func (m *moduleContext) InstallForceOS() (*OsType, *ArchType) { return m.module.InstallForceOS() } func (m *moduleContext) InstallInOdm() bool { return m.module.InstallInOdm() } func (m *moduleContext) InstallInProduct() bool { return m.module.InstallInProduct() } func (m *moduleContext) InstallInVendor() bool { return m.module.InstallInVendor() } Loading android/paths.go +33 −3 Original line number Diff line number Diff line Loading @@ -111,6 +111,9 @@ type ModuleInstallPathContext interface { InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallInOdm() bool InstallInProduct() bool InstallInVendor() bool InstallForceOS() (*OsType, *ArchType) } Loading Loading @@ -152,6 +155,18 @@ func (ctx *baseModuleContextToModuleInstallPathContext) InstallInRoot() bool { return ctx.Module().InstallInRoot() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallInOdm() bool { return ctx.Module().InstallInOdm() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallInProduct() bool { return ctx.Module().InstallInProduct() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallInVendor() bool { return ctx.Module().InstallInVendor() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) { return ctx.Module().InstallForceOS() } Loading Loading @@ -1866,11 +1881,11 @@ func modulePartition(ctx ModuleInstallPathContext, device bool) string { // the layout of recovery partion is the same as that of system partition partition = "recovery/root/system" } } else if ctx.SocSpecific() { } else if ctx.SocSpecific() || ctx.InstallInVendor() { partition = ctx.DeviceConfig().VendorPath() } else if ctx.DeviceSpecific() { } else if ctx.DeviceSpecific() || ctx.InstallInOdm() { partition = ctx.DeviceConfig().OdmPath() } else if ctx.ProductSpecific() { } else if ctx.ProductSpecific() || ctx.InstallInProduct() { partition = ctx.DeviceConfig().ProductPath() } else if ctx.SystemExtSpecific() { partition = ctx.DeviceConfig().SystemExtPath() Loading Loading @@ -2066,6 +2081,9 @@ type testModuleInstallPathContext struct { inDebugRamdisk bool inRecovery bool inRoot bool inOdm bool inProduct bool inVendor bool forceOS *OsType forceArch *ArchType } Loading Loading @@ -2108,6 +2126,18 @@ func (m testModuleInstallPathContext) InstallInRoot() bool { return m.inRoot } func (m testModuleInstallPathContext) InstallInOdm() bool { return m.inOdm } func (m testModuleInstallPathContext) InstallInProduct() bool { return m.inProduct } func (m testModuleInstallPathContext) InstallInVendor() bool { return m.inVendor } func (m testModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) { return m.forceOS, m.forceArch } Loading cc/cc_test.go +3 −3 Original line number Diff line number Diff line Loading @@ -194,13 +194,13 @@ func checkInstallPartition(t *testing.T, ctx *android.TestContext, name, variant } } socSpecific := func(m *Module) bool { return m.SocSpecific() || m.socSpecificModuleContext() return m.SocSpecific() || m.InstallInVendor() } deviceSpecific := func(m *Module) bool { return m.DeviceSpecific() || m.deviceSpecificModuleContext() return m.DeviceSpecific() || m.InstallInOdm() } productSpecific := func(m *Module) bool { return m.ProductSpecific() || m.productSpecificModuleContext() return m.ProductSpecific() || m.InstallInProduct() } systemExtSpecific := func(m *Module) bool { return m.SystemExtSpecific() Loading cc/image.go +3 −15 Original line number Diff line number Diff line Loading @@ -51,18 +51,6 @@ const ( ProductVariationPrefix = "product." ) func (ctx *moduleContext) ProductSpecific() bool { return ctx.ModuleContext.ProductSpecific() || ctx.mod.productSpecificModuleContext() } func (ctx *moduleContext) SocSpecific() bool { return ctx.ModuleContext.SocSpecific() || ctx.mod.socSpecificModuleContext() } func (ctx *moduleContext) DeviceSpecific() bool { return ctx.ModuleContext.DeviceSpecific() || ctx.mod.deviceSpecificModuleContext() } func (ctx *moduleContextImpl) inProduct() bool { return ctx.mod.InProduct() } Loading @@ -83,20 +71,20 @@ func (ctx *moduleContextImpl) inRecovery() bool { return ctx.mod.InRecovery() } func (c *Module) productSpecificModuleContext() bool { func (c *Module) InstallInProduct() bool { // Additionally check if this module is inProduct() that means it is a "product" variant of a // module. As well as product specific modules, product variants must be installed to /product. return c.InProduct() } func (c *Module) socSpecificModuleContext() bool { func (c *Module) InstallInVendor() bool { // Additionally check if this module is inVendor() that means it is a "vendor" variant of a // module. As well as SoC specific modules, vendor variants must be installed to /vendor // unless they have "odm_available: true". return c.HasVendorVariant() && c.InVendor() && !c.VendorVariantToOdm() } func (c *Module) deviceSpecificModuleContext() bool { func (c *Module) InstallInOdm() bool { // Some vendor variants want to be installed to /odm by setting "odm_available: true". return c.InVendor() && c.VendorVariantToOdm() } Loading Loading
android/module.go +10 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ type Module interface { InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallInOdm() bool InstallInProduct() bool InstallInVendor() bool InstallForceOS() (*OsType, *ArchType) PartitionTag(DeviceConfig) string Loading Loading @@ -1399,6 +1401,14 @@ func (m *ModuleBase) InstallInRecovery() bool { return Bool(m.commonProperties.Recovery) } func (m *ModuleBase) InstallInOdm() bool { return false } func (m *ModuleBase) InstallInProduct() bool { return false } func (m *ModuleBase) InstallInVendor() bool { return Bool(m.commonProperties.Vendor) || Bool(m.commonProperties.Soc_specific) || Bool(m.commonProperties.Proprietary) } Loading
android/module_context.go +10 −0 Original line number Diff line number Diff line Loading @@ -181,6 +181,8 @@ type ModuleContext interface { InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallInOdm() bool InstallInProduct() bool InstallInVendor() bool InstallForceOS() (*OsType, *ArchType) Loading Loading @@ -438,6 +440,14 @@ func (m *moduleContext) InstallForceOS() (*OsType, *ArchType) { return m.module.InstallForceOS() } func (m *moduleContext) InstallInOdm() bool { return m.module.InstallInOdm() } func (m *moduleContext) InstallInProduct() bool { return m.module.InstallInProduct() } func (m *moduleContext) InstallInVendor() bool { return m.module.InstallInVendor() } Loading
android/paths.go +33 −3 Original line number Diff line number Diff line Loading @@ -111,6 +111,9 @@ type ModuleInstallPathContext interface { InstallInDebugRamdisk() bool InstallInRecovery() bool InstallInRoot() bool InstallInOdm() bool InstallInProduct() bool InstallInVendor() bool InstallForceOS() (*OsType, *ArchType) } Loading Loading @@ -152,6 +155,18 @@ func (ctx *baseModuleContextToModuleInstallPathContext) InstallInRoot() bool { return ctx.Module().InstallInRoot() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallInOdm() bool { return ctx.Module().InstallInOdm() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallInProduct() bool { return ctx.Module().InstallInProduct() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallInVendor() bool { return ctx.Module().InstallInVendor() } func (ctx *baseModuleContextToModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) { return ctx.Module().InstallForceOS() } Loading Loading @@ -1866,11 +1881,11 @@ func modulePartition(ctx ModuleInstallPathContext, device bool) string { // the layout of recovery partion is the same as that of system partition partition = "recovery/root/system" } } else if ctx.SocSpecific() { } else if ctx.SocSpecific() || ctx.InstallInVendor() { partition = ctx.DeviceConfig().VendorPath() } else if ctx.DeviceSpecific() { } else if ctx.DeviceSpecific() || ctx.InstallInOdm() { partition = ctx.DeviceConfig().OdmPath() } else if ctx.ProductSpecific() { } else if ctx.ProductSpecific() || ctx.InstallInProduct() { partition = ctx.DeviceConfig().ProductPath() } else if ctx.SystemExtSpecific() { partition = ctx.DeviceConfig().SystemExtPath() Loading Loading @@ -2066,6 +2081,9 @@ type testModuleInstallPathContext struct { inDebugRamdisk bool inRecovery bool inRoot bool inOdm bool inProduct bool inVendor bool forceOS *OsType forceArch *ArchType } Loading Loading @@ -2108,6 +2126,18 @@ func (m testModuleInstallPathContext) InstallInRoot() bool { return m.inRoot } func (m testModuleInstallPathContext) InstallInOdm() bool { return m.inOdm } func (m testModuleInstallPathContext) InstallInProduct() bool { return m.inProduct } func (m testModuleInstallPathContext) InstallInVendor() bool { return m.inVendor } func (m testModuleInstallPathContext) InstallForceOS() (*OsType, *ArchType) { return m.forceOS, m.forceArch } Loading
cc/cc_test.go +3 −3 Original line number Diff line number Diff line Loading @@ -194,13 +194,13 @@ func checkInstallPartition(t *testing.T, ctx *android.TestContext, name, variant } } socSpecific := func(m *Module) bool { return m.SocSpecific() || m.socSpecificModuleContext() return m.SocSpecific() || m.InstallInVendor() } deviceSpecific := func(m *Module) bool { return m.DeviceSpecific() || m.deviceSpecificModuleContext() return m.DeviceSpecific() || m.InstallInOdm() } productSpecific := func(m *Module) bool { return m.ProductSpecific() || m.productSpecificModuleContext() return m.ProductSpecific() || m.InstallInProduct() } systemExtSpecific := func(m *Module) bool { return m.SystemExtSpecific() Loading
cc/image.go +3 −15 Original line number Diff line number Diff line Loading @@ -51,18 +51,6 @@ const ( ProductVariationPrefix = "product." ) func (ctx *moduleContext) ProductSpecific() bool { return ctx.ModuleContext.ProductSpecific() || ctx.mod.productSpecificModuleContext() } func (ctx *moduleContext) SocSpecific() bool { return ctx.ModuleContext.SocSpecific() || ctx.mod.socSpecificModuleContext() } func (ctx *moduleContext) DeviceSpecific() bool { return ctx.ModuleContext.DeviceSpecific() || ctx.mod.deviceSpecificModuleContext() } func (ctx *moduleContextImpl) inProduct() bool { return ctx.mod.InProduct() } Loading @@ -83,20 +71,20 @@ func (ctx *moduleContextImpl) inRecovery() bool { return ctx.mod.InRecovery() } func (c *Module) productSpecificModuleContext() bool { func (c *Module) InstallInProduct() bool { // Additionally check if this module is inProduct() that means it is a "product" variant of a // module. As well as product specific modules, product variants must be installed to /product. return c.InProduct() } func (c *Module) socSpecificModuleContext() bool { func (c *Module) InstallInVendor() bool { // Additionally check if this module is inVendor() that means it is a "vendor" variant of a // module. As well as SoC specific modules, vendor variants must be installed to /vendor // unless they have "odm_available: true". return c.HasVendorVariant() && c.InVendor() && !c.VendorVariantToOdm() } func (c *Module) deviceSpecificModuleContext() bool { func (c *Module) InstallInOdm() bool { // Some vendor variants want to be installed to /odm by setting "odm_available: true". return c.InVendor() && c.VendorVariantToOdm() } Loading