Add version suffix for stub modules' Android.mk

Becase there can be more than one stub libraries, LOCAL_MODULE should be
suffixed with SubName just like NDK stub.

Note that suffix should not be appended to the latest version if the
library is provided by APEX, Otherwise, those libs always need to be
referenced with suffix in .mk files.

Bug: 145796956
Test: m
Change-Id: If503fa651a63b0b215742553b250ecf5e0a30971
This commit is contained in:
Jooyung Han
2020-02-27 17:56:44 +09:00
parent 03b5185b88
commit ad4c18765e
2 changed files with 31 additions and 14 deletions

View File

@@ -244,6 +244,9 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries
if library.shared() && !library.buildStubs() {
ctx.subAndroidMk(entries, library.baseInstaller)
} else {
if library.buildStubs() {
entries.SubName = "." + library.stubsVersion()
}
entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true)
if library.buildStubs() {
@@ -254,6 +257,10 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries
if len(library.Properties.Stubs.Versions) > 0 &&
android.DirectlyInAnyApex(ctx, ctx.Name()) && !ctx.InRamdisk() && !ctx.InRecovery() && !ctx.UseVndk() &&
!ctx.static() {
if library.buildStubs() && library.isLatestStubVersion() {
// reference the latest version via its name without suffix when it is provided by apex
entries.SubName = ""
}
if !library.buildStubs() {
entries.SubName = ".bootstrap"
}