Convert Visit*Deps from blueprint.Module to android.Module

Also adds checks that the dependencies are android.Modules and
are not disabled.

Test: m checkbuild
Change-Id: I05e945f38915d49cd3c0ab72a86576949bc7eff2
diff --git a/java/app.go b/java/app.go
index 42ae236..e8028a0 100644
--- a/java/app.go
+++ b/java/app.go
@@ -20,7 +20,6 @@
 	"path/filepath"
 	"strings"
 
-	"github.com/google/blueprint"
 	"github.com/google/blueprint/proptools"
 
 	"android/soong/android"
@@ -231,7 +230,7 @@
 	aaptFlags = append(aaptFlags, android.JoinWithPrefix(assetDirs.Strings(), "-A "))
 	aaptFlags = append(aaptFlags, android.JoinWithPrefix(resourceDirs.Strings(), "-S "))
 
-	ctx.VisitDirectDeps(func(module blueprint.Module) {
+	ctx.VisitDirectDeps(func(module android.Module) {
 		var depFiles android.Paths
 		if javaDep, ok := module.(Dependency); ok {
 			if ctx.OtherModuleName(module) == "framework-res" {
diff --git a/java/java.go b/java/java.go
index c12ada2..26514f3 100644
--- a/java/java.go
+++ b/java/java.go
@@ -406,25 +406,10 @@
 		deps.aidlIncludeDirs = append(deps.aidlIncludeDirs, sdkDep.aidl)
 	}
 
-	ctx.VisitDirectDeps(func(module blueprint.Module) {
+	ctx.VisitDirectDeps(func(module android.Module) {
 		otherName := ctx.OtherModuleName(module)
 		tag := ctx.OtherModuleDependencyTag(module)
 
-		aDep, _ := module.(android.Module)
-		if aDep == nil {
-			ctx.ModuleErrorf("module %q not an android module", ctx.OtherModuleName(aDep))
-			return
-		}
-
-		if !aDep.Enabled() {
-			if ctx.AConfig().AllowMissingDependencies() {
-				ctx.AddMissingDependencies([]string{ctx.OtherModuleName(aDep)})
-			} else {
-				ctx.ModuleErrorf("depends on disabled module %q", ctx.OtherModuleName(aDep))
-			}
-			return
-		}
-
 		dep, _ := module.(Dependency)
 		if dep == nil {
 			switch tag {
diff --git a/java/system_modules.go b/java/system_modules.go
index f6f572b..a459b7a 100644
--- a/java/system_modules.go
+++ b/java/system_modules.go
@@ -112,7 +112,7 @@
 func (system *SystemModules) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	var jars android.Paths
 
-	ctx.VisitDirectDeps(func(module blueprint.Module) {
+	ctx.VisitDirectDeps(func(module android.Module) {
 		if ctx.OtherModuleDependencyTag(module) == libTag {
 			dep, _ := module.(Dependency)
 			jars = append(jars, dep.HeaderJars()...)