Don't visit disabled modules with SOONG_COLLECT_JAVA_DEPS=true
Calling AndroidMk() on a disabled module may not be safe because
the module will not have had GenerateAndroidBuildActions() called
on it to initialize the data structures that AndroidMk() expects
to exist. Check module.Enabled() before generating IDE info.
Fixes: 129089976
Test: SOONG_COLLECT_JAVA_DEPS=true m nothing
Change-Id: Icd79088c532c1842801f2bf89d92bc1a67109936
diff --git a/java/jdeps.go b/java/jdeps.go
index 2eaeab8..18498be 100644
--- a/java/jdeps.go
+++ b/java/jdeps.go
@@ -51,6 +51,10 @@
moduleInfos := make(map[string]android.IdeInfo)
ctx.VisitAllModules(func(module android.Module) {
+ if !module.Enabled() {
+ return
+ }
+
ideInfoProvider, ok := module.(android.IDEInfo)
if !ok {
return