Check vndk-private with the IsVndkPrivate()
*_available will not provide if a module is VNDK-private or not.
Fixed it by using IsVndkPrivate() with private() interface.
By allowing exclude_from_vendor_snapshot for vendor_available
modules, available() interface is no longer required. Tests are
updated for exclude_from_vendor_snapshot on vendor_available modules.
Bug: 175768895
Test: m nothing
Change-Id: I9ff85256170d59b378a4c354d5c007cfbeacabc5
diff --git a/cc/snapshot_prebuilt.go b/cc/snapshot_prebuilt.go
index d9c46ea..2003e03 100644
--- a/cc/snapshot_prebuilt.go
+++ b/cc/snapshot_prebuilt.go
@@ -40,10 +40,10 @@
// evalution of a function that may be not be defined.
inImage(m *Module) func() bool
- // Returns the value of the "available" property for a given module for
- // and snapshot, e.g., "vendor_available", "recovery_available", etc.
- // or nil if the property is not defined.
- available(m *Module) *bool
+ // Returns true if the module is private and must not be included in the
+ // snapshot. For example VNDK-private modules must return true for the
+ // vendor snapshots. But false for the recovery snapshots.
+ private(m *Module) bool
// Returns true if a dir under source tree is an SoC-owned proprietary
// directory, such as device/, vendor/, etc.
@@ -112,8 +112,8 @@
return m.InVendor
}
-func (vendorSnapshotImage) available(m *Module) *bool {
- return m.VendorProperties.Vendor_available
+func (vendorSnapshotImage) private(m *Module) bool {
+ return m.IsVndkPrivate()
}
func (vendorSnapshotImage) isProprietaryPath(dir string) bool {
@@ -227,8 +227,9 @@
return m.InRecovery
}
-func (recoverySnapshotImage) available(m *Module) *bool {
- return m.Properties.Recovery_available
+// recovery snapshot does not have private libraries.
+func (recoverySnapshotImage) private(m *Module) bool {
+ return false
}
func (recoverySnapshotImage) isProprietaryPath(dir string) bool {