Cleanup ImageInterface.SetImageVariation
This change modifies the interface method of ImageInterface.SetImageVariation so that the image variation is set directly at the caller image variation module, instead of passing the pointer to set the image variation. Test: m nothing Change-Id: I8eadb5149365530243e19a8cd37eb49d335fbeef
This commit is contained in:
27
cc/image.go
27
cc/image.go
@@ -628,30 +628,29 @@ func squashRamdiskSrcs(m *Module) {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) {
|
||||
m := module.(*Module)
|
||||
func (c *Module) SetImageVariation(ctx android.BaseModuleContext, variant string) {
|
||||
if variant == android.RamdiskVariation {
|
||||
m.MakeAsPlatform()
|
||||
squashRamdiskSrcs(m)
|
||||
c.MakeAsPlatform()
|
||||
squashRamdiskSrcs(c)
|
||||
} else if variant == android.VendorRamdiskVariation {
|
||||
m.MakeAsPlatform()
|
||||
squashVendorRamdiskSrcs(m)
|
||||
c.MakeAsPlatform()
|
||||
squashVendorRamdiskSrcs(c)
|
||||
} else if variant == android.RecoveryVariation {
|
||||
m.MakeAsPlatform()
|
||||
squashRecoverySrcs(m)
|
||||
c.MakeAsPlatform()
|
||||
squashRecoverySrcs(c)
|
||||
} else if strings.HasPrefix(variant, VendorVariation) {
|
||||
m.Properties.ImageVariation = VendorVariation
|
||||
c.Properties.ImageVariation = VendorVariation
|
||||
|
||||
if strings.HasPrefix(variant, VendorVariationPrefix) {
|
||||
m.Properties.VndkVersion = strings.TrimPrefix(variant, VendorVariationPrefix)
|
||||
c.Properties.VndkVersion = strings.TrimPrefix(variant, VendorVariationPrefix)
|
||||
}
|
||||
squashVendorSrcs(m)
|
||||
squashVendorSrcs(c)
|
||||
} else if strings.HasPrefix(variant, ProductVariation) {
|
||||
m.Properties.ImageVariation = ProductVariation
|
||||
c.Properties.ImageVariation = ProductVariation
|
||||
if strings.HasPrefix(variant, ProductVariationPrefix) {
|
||||
m.Properties.VndkVersion = strings.TrimPrefix(variant, ProductVariationPrefix)
|
||||
c.Properties.VndkVersion = strings.TrimPrefix(variant, ProductVariationPrefix)
|
||||
}
|
||||
squashProductSrcs(m)
|
||||
squashProductSrcs(c)
|
||||
}
|
||||
|
||||
if c.NeedsVendorPublicLibraryVariants() &&
|
||||
|
Reference in New Issue
Block a user