Merge "Cleanup ImageInterface.SetImageVariation" into main am: 77858402e4

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3131759

Change-Id: I4504623d0978356eb7f3b526d01ffb99abd0da12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2024-06-14 04:29:12 +00:00
committed by Automerger Merge Worker
9 changed files with 30 additions and 35 deletions

View File

@@ -197,21 +197,20 @@ func (mod *Module) InVendorOrProduct() bool {
return mod.InVendor() || mod.InProduct()
}
func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant string, module android.Module) {
m := module.(*Module)
func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant string) {
if variant == android.VendorRamdiskVariation {
m.MakeAsPlatform()
mod.MakeAsPlatform()
} else if variant == android.RecoveryVariation {
m.MakeAsPlatform()
mod.MakeAsPlatform()
} else if strings.HasPrefix(variant, cc.VendorVariation) {
m.Properties.ImageVariation = cc.VendorVariation
mod.Properties.ImageVariation = cc.VendorVariation
if strings.HasPrefix(variant, cc.VendorVariationPrefix) {
m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix)
mod.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix)
}
} else if strings.HasPrefix(variant, cc.ProductVariation) {
m.Properties.ImageVariation = cc.ProductVariation
mod.Properties.ImageVariation = cc.ProductVariation
if strings.HasPrefix(variant, cc.ProductVariationPrefix) {
m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.ProductVariationPrefix)
mod.Properties.VndkVersion = strings.TrimPrefix(variant, cc.ProductVariationPrefix)
}
}
}