Move vendor and product variant generation logic from cc package to android package

Although image variation generation logic has moved out of cc package to
the android package, the vendor and product partition variants
generation logic is still specific to cc package. Therefore, in order to
create a product or vendor variant, they have to specified in
`ExtraImageVariants`. In order to avoid such confusing behaviors and
enforce modules to specify product and vendor installation rules, this
change moves the vendor and product variant generation logic to
android.ImageInterface.

Test: m nothing --no-skip-soong-tests && diff contents of out/soong/Android-{product}.mk
Change-Id: I9e14f3739d9dea94167ee6a91e92b2f942055aba
This commit is contained in:
Jihoon Kang
2024-06-19 00:51:16 +00:00
parent 25cdff6815
commit 47e918450f
12 changed files with 137 additions and 92 deletions

View File

@@ -216,6 +216,14 @@ var _ android.ImageInterface = (*PrebuiltEtc)(nil)
func (p *PrebuiltEtc) ImageMutatorBegin(ctx android.BaseModuleContext) {}
func (p *PrebuiltEtc) VendorVariantNeeded(ctx android.BaseModuleContext) bool {
return false
}
func (p *PrebuiltEtc) ProductVariantNeeded(ctx android.BaseModuleContext) bool {
return false
}
func (p *PrebuiltEtc) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
return !p.ModuleBase.InstallInRecovery() && !p.ModuleBase.InstallInRamdisk() &&
!p.ModuleBase.InstallInVendorRamdisk() && !p.ModuleBase.InstallInDebugRamdisk()