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/cc.go b/cc/cc.go
index 26250a7..ac6a258 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1076,11 +1076,27 @@
c.BaseModuleName() != "libft2")
}
+// Returns true for LLNDK-private, VNDK-SP-private, and VNDK-core-private.
func (c *Module) IsVndkPrivate() bool {
- // Returns true for LLNDK-private, VNDK-SP-private, and VNDK-core-private.
- library, _ := c.library.(*libraryDecorator)
- return library != nil && !Bool(library.Properties.Llndk.Vendor_available) &&
- !Bool(c.VendorProperties.Vendor_available) && !c.IsVndkExt()
+ // 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
+ }
+
+ // 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 false
}
func (c *Module) IsVndk() bool {