Define vndk.private property for VNDK-private libraries
To define VNDK-private libraries, we used `vendor_available: false`.
Because of it, `vendor_available == nil` had different meaning from
`vendor_available: false` for the VNDK libraries.
To clarify this, we change the logic for defining VNDK-private
libraries which was:
cc_library {
name: "vndk_private",
vendor_available: false,
product_available: false,
vndk: {
enabled: true,
},
}
It must be replaced with
cc_library {
name: "vndk_private",
vendor_available: true,
product_available: true,
vndk: {
enabled: true,
private: true,
},
}
Bug: 175768895
Test: m nothing
Change-Id: I81769f57c2231e54b682a28e4b82631ab9f3d390
diff --git a/cc/image.go b/cc/image.go
index b55e1f4..13d77cc 100644
--- a/cc/image.go
+++ b/cc/image.go
@@ -245,13 +245,9 @@
"vendor_available must be set to either true or false when `vndk: {enabled: true}`")
}
if m.VendorProperties.Product_available != nil {
- // If product_available is defined for a VNDK, make sure vendor_available and
- // product_available has the same value since `false` for these properties
- // means the module is VNDK-private.
- if Bool(m.VendorProperties.Vendor_available) != Bool(m.VendorProperties.Product_available) {
- mctx.PropertyErrorf("product_available", "may not have different value than `vendor_available` for a VNDK")
- }
- // Also, both variants must have the same properties since they share a single VNDK library on runtime.
+ // If a VNDK module creates both product and vendor variants, they
+ // must have the same properties since they share a single VNDK
+ // library on runtime.
if !m.compareVendorAndProductProps() {
mctx.ModuleErrorf("product properties must have the same values with the vendor properties for VNDK modules")
}