From 33db5cbf6e965c233dfb3fee078176c16f9a0f6f Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Fri, 9 Apr 2021 21:33:07 +0200 Subject: [PATCH] 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 --- cc/image.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cc/image.go b/cc/image.go index afe6a0e0c..2af7c9ee2 100644 --- a/cc/image.go +++ b/cc/image.go @@ -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 {