Add [soc|device|product]_specific
Added three properties (soc_specific, device_specific, and
product_specific) that shows what a module is specific to.
`soc_specific: true` means that the module is specific to an SoC
(System-On-a-Chip) and thus need to be installed to vendor partition.
This has the same meaning as the old `vendor: true` setting.
`device_specific: true` means that the module is specific to the entire
hardware configuration of a device includeing the SoC and off-chip
peripherals. These modules are installed to odm partition (or /vendor/odm
when odm partition does not exist).
`product_specific: true` means that the module is specific to the
software configuration of a product such as country, network operator,
etc. These modules are installed to oem partition (or /system/oem when
oem partition does not exist). These modules are assumed to be agnostic
to hardware, so this property can't be true when either soc_specific or
device_specific is set to true.
Bug: 68187740
Test: Build. path_tests amended.
Change-Id: I44ff055d87d53b0d2676758c506060de54cbffa0
diff --git a/cc/cc.go b/cc/cc.go
index 04aa6a6..13d0e3b 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -425,8 +425,9 @@
moduleContextImpl
}
-func (ctx *moduleContext) InstallOnVendorPartition() bool {
- return ctx.ModuleContext.InstallOnVendorPartition() || (ctx.mod.useVndk() && !ctx.mod.isVndk())
+func (ctx *moduleContext) SocSpecific() bool {
+ return ctx.ModuleContext.SocSpecific() ||
+ (ctx.mod.hasVendorVariant() && ctx.mod.useVndk() && !ctx.mod.isVndk())
}
type moduleContextImpl struct {
@@ -1402,7 +1403,7 @@
mctx.CreateVariations(coreMode)
} else if Bool(props.Vendor_available) {
mctx.CreateVariations(coreMode, vendorMode)
- } else if mctx.InstallOnVendorPartition() {
+ } else if mctx.SocSpecific() || mctx.DeviceSpecific() {
mctx.CreateVariations(vendorMode)
} else {
mctx.CreateVariations(coreMode)
@@ -1416,9 +1417,9 @@
}
// Sanity check
- if m.VendorProperties.Vendor_available != nil && mctx.InstallOnVendorPartition() {
+ if m.VendorProperties.Vendor_available != nil && (mctx.SocSpecific() || mctx.DeviceSpecific()) {
mctx.PropertyErrorf("vendor_available",
- "doesn't make sense at the same time as `vendor: true` or `proprietary: true`")
+ "doesn't make sense at the same time as `vendor: true`, `proprietary: true`, or `device_specific:true`")
return
}
if vndk := m.vndkdep; vndk != nil {
@@ -1460,8 +1461,8 @@
vendor := mod[1].(*Module)
vendor.Properties.UseVndk = true
squashVendorSrcs(vendor)
- } else if mctx.InstallOnVendorPartition() && String(m.Properties.Sdk_version) == "" {
- // This will be available in /vendor only
+ } else if (mctx.SocSpecific() || mctx.DeviceSpecific()) && String(m.Properties.Sdk_version) == "" {
+ // This will be available in /vendor (or /odm) only
mod := mctx.CreateVariations(vendorMode)
vendor := mod[0].(*Module)
vendor.Properties.UseVndk = true