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
diff --git a/cc/androidmk.go b/cc/androidmk.go
index bde096b..786d2bc 100644
--- a/cc/androidmk.go
+++ b/cc/androidmk.go
@@ -16,6 +16,7 @@
import (
"android/soong/aconfig"
+
"github.com/google/blueprint/proptools"
"fmt"
@@ -51,6 +52,7 @@
InVendorRamdisk() bool
InRecovery() bool
NotInPlatform() bool
+ InVendorOrProduct() bool
}
type subAndroidMkProvider interface {
@@ -294,7 +296,7 @@
// they can be exceptionally used directly when APEXes are not available (e.g. during the
// very early stage in the boot process).
if len(library.Properties.Stubs.Versions) > 0 && !ctx.Host() && ctx.NotInPlatform() &&
- !ctx.InRamdisk() && !ctx.InVendorRamdisk() && !ctx.InRecovery() && !ctx.UseVndk() && !ctx.static() {
+ !ctx.InRamdisk() && !ctx.InVendorRamdisk() && !ctx.InRecovery() && !ctx.InVendorOrProduct() && !ctx.static() {
if library.buildStubs() && library.isLatestStubVersion() {
entries.SubName = ""
}