Skip MIPS headers when generating NDK prebuilts

When generating NDK prebuilts, skip installing MIPS headers, but keep
them when doing regular platform build. Ndk_abis property is only set
to true with build/soong/scripts/build-ndk-prebuilts.sh

Revert this once MIPS is supported in NDK again.

This effectively skips installing the following header modules when
creating NDK prebuilts:
- libc_asm_mips
- libc_asm_mips64

This fixes the issue introduced by commit:
050f046 Remove mips/mips64 headers from the NDK sysroot.

Test: build/soong/scripts/build-ndk-prebuilts.sh
Test: build aosp_mips[64]-eng

Change-Id: I3af73649bc8ac304bca0e21ec81f156abe546c90
Signed-off-by: Lazar Trsic <Lazar.Trsic@mips.com>
diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go
index 0458fb6..bfbf0f5 100644
--- a/cc/ndk_headers.go
+++ b/cc/ndk_headers.go
@@ -18,6 +18,7 @@
 	"fmt"
 	"os"
 	"path/filepath"
+	"strings"
 
 	"github.com/google/blueprint"
 
@@ -119,6 +120,14 @@
 
 	m.licensePath = android.PathForModuleSrc(ctx, String(m.properties.License))
 
+	// When generating NDK prebuilts, skip installing MIPS headers,
+	// but keep them when doing regular platform build.
+	// Ndk_abis property is only set to true with build/soong/scripts/build-ndk-prebuilts.sh
+	// TODO: Revert this once MIPS is supported in NDK again.
+	if Bool(ctx.AConfig().Ndk_abis) && strings.Contains(ctx.ModuleName(), "mips") {
+		return
+	}
+
 	srcFiles := ctx.ExpandSources(m.properties.Srcs, nil)
 	for _, header := range srcFiles {
 		installDir := getHeaderInstallDir(ctx, header, String(m.properties.From),