aboutsummaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorNicolas Geoffray <ngeoffray@google.com>2019-01-15 19:53:23 +0000
committerNicolas Geoffray <ngeoffray@google.com>2019-01-16 23:37:07 +0000
commitc22c1bf130a7c60c193aece472eab2ae648a1fcb (patch)
tree26763959cfbbebf8989031852f6666fd7d6f68b3 /android
parent63d91fad6a565c4be99ca0af6f9b8581a12354c7 (diff)
downloadbuild_soong-c22c1bf130a7c60c193aece472eab2ae648a1fcb.tar.gz
build_soong-c22c1bf130a7c60c193aece472eab2ae648a1fcb.tar.bz2
build_soong-c22c1bf130a7c60c193aece472eab2ae648a1fcb.zip
Return false in DirectlyInAnyApex for host libraries.
Host doesn't have apexes. Bug: 122947954 Test: build dex2oat, check that libnativebridge is installed. Change-Id: I3548e3f155a200e56d71e88631b71511bad84161
Diffstat (limited to 'android')
-rw-r--r--android/apex.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/android/apex.go b/android/apex.go
index 8d99d56f..a93baf6d 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -178,8 +178,16 @@ func DirectlyInApex(apexName string, moduleName string) bool {
return false
}
+type hostContext interface {
+ Host() bool
+}
+
// Tests whether a module named moduleName is directly depended on by any APEX.
-func DirectlyInAnyApex(moduleName string) bool {
+func DirectlyInAnyApex(ctx hostContext, moduleName string) bool {
+ if ctx.Host() {
+ // Host has no APEX.
+ return false
+ }
apexNamesMapMutex.Lock()
defer apexNamesMapMutex.Unlock()
if apexNames, ok := apexNamesMap()[moduleName]; ok {