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
This commit is contained in:
Justin Yun
2020-12-23 18:23:14 +09:00
parent 6977e8a80c
commit fd9e804470
4 changed files with 76 additions and 85 deletions

View File

@@ -245,13 +245,9 @@ func (m *Module) ImageMutatorBegin(mctx android.BaseModuleContext) {
"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")
}