Define product_available property

To make a module available to product variants, it must define
`product_available: true`. `vendor_available: true` will not create
product variants any more.
However, in this CL, we don't change the behavior of
`vendor_available` property. It still creates both variants. After we
update all Android.bp files that need to provide product variants
with `product_available: true`, we may upload the remaining patches.

Bug: 150902910
Test: lunch aosp_arm64-userdebug && m
Change-Id: I0fd5be7bbae2c45d5cab3c3c2ca49f53a9b6f975
This commit is contained in:
Justin Yun
2020-10-29 16:49:43 +09:00
parent b0a713acf9
commit 63e9ec70bb
16 changed files with 344 additions and 102 deletions

View File

@@ -143,6 +143,9 @@ type syspropLibraryProperties struct {
// Make this module available when building for vendor
Vendor_available *bool
// Make this module available when building for product
Product_available *bool
// list of .sysprop files which defines the properties.
Srcs []string `android:"path"`
@@ -353,6 +356,7 @@ type ccLibraryProperties struct {
Recovery *bool
Recovery_available *bool
Vendor_available *bool
Product_available *bool
Host_supported *bool
Apex_available []string
Min_sdk_version *string
@@ -449,6 +453,7 @@ func syspropLibraryHook(ctx android.LoadHookContext, m *syspropLibrary) {
ccProps.Target.Host.Static_libs = []string{"libbase", "liblog"}
ccProps.Recovery_available = m.properties.Recovery_available
ccProps.Vendor_available = m.properties.Vendor_available
ccProps.Product_available = m.properties.Product_available
ccProps.Host_supported = m.properties.Host_supported
ccProps.Apex_available = m.ApexProperties.Apex_available
ccProps.Min_sdk_version = m.properties.Cpp.Min_sdk_version