Install device_specific cc_prebuilt to ODM

In aosp/531337 support for installing prebuilts to vendor and odm
partitions was introduced.

Since aosp/1542687 allowed installing vendor variants to odm, we
started to see device_specific cc_prebuilts not installed to odm
at all.

The reason for this is the InVendor condition is true for the
device_specific module and VendorVariantToOdm is false in cases
outside the one it was designed for, so SocSpecific returns true and
the module gets installed to vendor instead of odm.

We need to check if we're specifically building a vendor variant
before triggering this VendorVariantToOdm logic.

Bug: 184885453
Change-Id: I05be06a61c5fc3f2f72599eb4746c9c0523b956e
This commit is contained in:
Robin Lee 2021-04-09 21:33:07 +02:00 committed by Justin Yun
parent eed4716def
commit 33db5cbf6e
1 changed files with 4 additions and 2 deletions

View File

@ -58,12 +58,14 @@ func (ctx *moduleContext) SocSpecific() 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 ctx.ModuleContext.SocSpecific() || (ctx.mod.InVendor() && !ctx.mod.VendorVariantToOdm())
return ctx.ModuleContext.SocSpecific() ||
(ctx.mod.HasVendorVariant() && ctx.mod.InVendor() && !ctx.mod.VendorVariantToOdm())
}
func (ctx *moduleContext) DeviceSpecific() bool {
// Some vendor variants want to be installed to /odm by setting "odm_available: true".
return ctx.ModuleContext.DeviceSpecific() || (ctx.mod.InVendor() && ctx.mod.VendorVariantToOdm())
return ctx.ModuleContext.DeviceSpecific() ||
(ctx.mod.HasVendorVariant() && ctx.mod.InVendor() && ctx.mod.VendorVariantToOdm())
}
func (ctx *moduleContextImpl) inProduct() bool {