Split usage of UseVndk

UseVndk is a function to check if the module can use VNDK libraries, but
this function was also used to check if the module is installed in the
treblelized partition (vendor or product). As of VNDK deprecation,
UseVndk funtion will return false even when the module is installed in
vendor / product partition, so we need a separated function to check
this. This change introduces a new function 'InVendorOrProduct' which
replaces UseVndk based on its usage.

Bug: 316829758
Test: m nothing --no-skip-soong-tests passed
Change-Id: Ic61fcd16c4554c355f6005894a4519b044b27fe5
This commit is contained in:
Kiyoung Kim
2024-01-08 12:55:45 +09:00
parent 208444ce5d
commit aa39480d21
16 changed files with 45 additions and 25 deletions

View File

@@ -48,7 +48,7 @@ func updateImportedLibraryDependency(ctx android.BottomUpMutatorContext) {
return
}
if m.UseVndk() && apiLibrary.hasLLNDKStubs() {
if m.InVendorOrProduct() && apiLibrary.hasLLNDKStubs() {
// Add LLNDK variant dependency
if inList("llndk", apiLibrary.properties.Variants) {
variantName := BuildApiVariantName(m.BaseModuleName(), "llndk", "")
@@ -193,7 +193,7 @@ func (d *apiLibraryDecorator) link(ctx ModuleContext, flags Flags, deps PathDeps
}
}
if m.UseVndk() && d.hasLLNDKStubs() {
if m.InVendorOrProduct() && d.hasLLNDKStubs() {
// LLNDK variant
load_cc_variant(BuildApiVariantName(m.BaseModuleName(), "llndk", ""))
} else if m.IsSdkVariant() {
@@ -312,7 +312,7 @@ func (d *apiLibraryDecorator) stubsVersions(ctx android.BaseMutatorContext) []st
}
}
if d.hasLLNDKStubs() && m.UseVndk() {
if d.hasLLNDKStubs() && m.InVendorOrProduct() {
// LLNDK libraries only need a single stubs variant.
return []string{android.FutureApiLevel.String()}
}