VNDK APEX should not provide native libs

While libz has stubs for other mainline modules, it doesn't provide
stubs when it is used as a VNDK lib.

In general, VNDK libs are only for vendor modules. So, we skip them even
if they have stubs.

Bug: 155456180
Test: m com.android.vndk.current
      provideNativeLibs of the APEX should be empty
Change-Id: I22401a2b1732a8560802c5be850181682e183a8e
This commit is contained in:
Jooyung Han
2020-06-15 14:59:42 +09:00
parent 000aef69b5
commit 45a96778c1
2 changed files with 38 additions and 2 deletions

View File

@@ -1954,8 +1954,10 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
fi := apexFileForNativeLibrary(ctx, c, handleSpecialLibs)
fi.isJniLib = isJniLib
filesInfo = append(filesInfo, fi)
// bootstrap bionic libs are treated as provided by system
if c.HasStubsVariants() && !cc.InstallToBootstrap(c.BaseModuleName(), ctx.Config()) {
// Collect the list of stub-providing libs except:
// - VNDK libs are only for vendors
// - bootstrap bionic libs are treated as provided by system
if c.HasStubsVariants() && !a.vndkApex && !cc.InstallToBootstrap(c.BaseModuleName(), ctx.Config()) {
provideNativeLibs = append(provideNativeLibs, fi.Stem())
}
return true // track transitive dependencies