Don't copy uninstallable variants of NDK libraries to sysroot
After the next patch libraryDecorator.install will be called for
uninstallable variants of modules, manually filter them out when
copying to the NDK sysroot.
Bug: 124313442
Test: m checkbuild
Change-Id: I28b538d4ae271dc5e27c386d7cfa538ac0ed841b
diff --git a/cc/library.go b/cc/library.go
index 959d670..73ff754 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -1345,7 +1345,7 @@
if Bool(library.Properties.Static_ndk_lib) && library.static() &&
!ctx.useVndk() && !ctx.inRamdisk() && !ctx.inVendorRamdisk() && !ctx.inRecovery() && ctx.Device() &&
library.baseLinker.sanitize.isUnsanitizedVariant() &&
- !library.buildStubs() && ctx.sdkVersion() == "" {
+ ctx.isForPlatform() && !ctx.isPreventInstall() {
installPath := getNdkSysrootBase(ctx).Join(
ctx, "usr/lib", config.NDKTriple(ctx.toolchain()), file.Base())