Allow sysprop library API files to be missing

If sysprop library contains only internal properties, the API txt file
will be empty. This allows the API files to be missing in such cases to
turn off API-Review bit.

Bug: 177036449
Test: manual test
Change-Id: I9792e46ce6d19e65ee83cb055f76069063bec281
This commit is contained in:
Inseob Kim 2021-01-15 18:10:29 +09:00
parent 150355b1c3
commit 3a3539a27b

View file

@ -382,11 +382,13 @@ func (m *selinuxContextsModule) buildPropertyContexts(ctx android.ModuleContext,
var apiFiles android.Paths
ctx.VisitDirectDepsWithTag(syspropLibraryDepTag, func(c android.Module) {
i, ok := c.(interface{ CurrentSyspropApiFile() android.Path })
i, ok := c.(interface{ CurrentSyspropApiFile() android.OptionalPath })
if !ok {
panic(fmt.Errorf("unknown dependency %q for %q", ctx.OtherModuleName(c), ctx.ModuleName()))
}
apiFiles = append(apiFiles, i.CurrentSyspropApiFile())
if api := i.CurrentSyspropApiFile(); api.Valid() {
apiFiles = append(apiFiles, api.Path())
}
})
// check compatibility with sysprop_library