Merge "Refine sysprop_library header rules" am: 4c4de0edc3 am: 1ee0c0c4ba

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1553459

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I6b9906a4bc0a7f2acf5865edc10471dd309d4f4b
This commit is contained in:
Inseob Kim
2021-01-20 02:01:32 +00:00
committed by Automerger Merge Worker

View File

@@ -1318,17 +1318,13 @@ func (library *libraryDecorator) link(ctx ModuleContext,
if library.baseCompiler.hasSrcExt(".sysprop") { if library.baseCompiler.hasSrcExt(".sysprop") {
dir := android.PathForModuleGen(ctx, "sysprop", "include") dir := android.PathForModuleGen(ctx, "sysprop", "include")
if library.Properties.Sysprop.Platform != nil { if library.Properties.Sysprop.Platform != nil {
isClientProduct := ctx.ProductSpecific() && !ctx.useVndk()
isClientVendor := ctx.useVndk()
isOwnerPlatform := Bool(library.Properties.Sysprop.Platform) isOwnerPlatform := Bool(library.Properties.Sysprop.Platform)
// If the owner is different from the user, expose public header. That is, // If the owner is different from the user, expose public header. That is,
// 1) if the user is product (as owner can only be platform / vendor) // 1) if the user is product (as owner can only be platform / vendor)
// 2) if one is platform and the other is vendor // 2) if the owner is platform and the client is vendor
// Exceptions are ramdisk and recovery. They are not enforced at all. So // We don't care Platform -> Vendor dependency as it's already forbidden.
// they always use internal header. if ctx.Device() && (ctx.ProductSpecific() || (isOwnerPlatform && ctx.inVendor())) {
if !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() &&
(isClientProduct || (isOwnerPlatform == isClientVendor)) {
dir = android.PathForModuleGen(ctx, "sysprop/public", "include") dir = android.PathForModuleGen(ctx, "sysprop/public", "include")
} }
} }