Do not read 'vendor_available: false'
In case of VNDK, 'vendor_available: false' had a special meaning that
defines VNDK-private libraries. It is not trivial because not
defining a boolean property means 'false' normally. To avoid the
confusion replace it with the 'vndk.private: true' for VNDK-private
libraries and 'private: true' for LLNDK-private libraries.
All VNDK libraries must define 'vendor_available: true' and may have
'vndk.private: true' if they are VNDK-private.
With this change '(vendor|product)_available: false' is the same as
not defining the property.
LLNDK-private must define 'private: true' instead of
'vendor_available: false'.
Bug: 175768895
Test: build
Change-Id: I57fbca351be317257d95027f3cdcdbbe537eab23
diff --git a/cc/cc.go b/cc/cc.go
index 0d0aec7..f45b654 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -419,7 +419,7 @@
IsLLNDK bool `blueprint:"mutated"`
// IsLLNDKPrivate is set to true for the vendor variant of a cc_library module that has LLNDK
- // stubs and also sets llndk.vendor_available: false.
+ // stubs and also sets llndk.private: true.
IsLLNDKPrivate bool `blueprint:"mutated"`
}
@@ -1079,11 +1079,11 @@
func (c *Module) isImplementationForLLNDKPublic() bool {
library, _ := c.library.(*libraryDecorator)
return library != nil && library.hasLLNDKStubs() &&
- (Bool(library.Properties.Llndk.Vendor_available) ||
+ (!Bool(library.Properties.Llndk.Private) ||
// TODO(b/170784825): until the LLNDK properties are moved into the cc_library,
// the non-Vendor variants of the cc_library don't know if the corresponding
- // llndk_library set vendor_available: false. Since libft2 is the only
- // private LLNDK library, hardcode it during the transition.
+ // llndk_library set private: true. Since libft2 is the only private LLNDK
+ // library, hardcode it during the transition.
c.BaseModuleName() != "libft2")
}
@@ -1091,20 +1091,12 @@
func (c *Module) IsVndkPrivate() bool {
// Check if VNDK-core-private or VNDK-SP-private
if c.IsVndk() {
- if Bool(c.vndkdep.Properties.Vndk.Private) {
- return true
- }
- // TODO(b/175768895) remove this when we clean up "vendor_available: false" use cases.
- if c.VendorProperties.Vendor_available != nil && !Bool(c.VendorProperties.Vendor_available) {
- return true
- }
- return false
+ return Bool(c.vndkdep.Properties.Vndk.Private)
}
// Check if LLNDK-private
if library, ok := c.library.(*libraryDecorator); ok && c.IsLlndk() {
- // TODO(b/175768895) replace this with 'private' property.
- return !Bool(library.Properties.Llndk.Vendor_available)
+ return Bool(library.Properties.Llndk.Private)
}
return false