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/cc/cc.go b/cc/cc.go
index 36b97e1..b423ca6 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -1037,16 +1037,10 @@
 
 	directStaticDeps := []*Module{}
 
-	ctx.VisitDirectDeps(func(dep blueprint.Module) {
+	ctx.VisitDirectDeps(func(dep android.Module) {
 		depName := ctx.OtherModuleName(dep)
 		depTag := ctx.OtherModuleDependencyTag(dep)
 
-		aDep, _ := dep.(android.Module)
-		if aDep == nil {
-			ctx.ModuleErrorf("module %q not an android module", depName)
-			return
-		}
-
 		ccDep, _ := dep.(*Module)
 		if ccDep == nil {
 			// handling for a few module types that aren't cc Module but that are also supported
@@ -1096,20 +1090,11 @@
 			return
 		}
 
-		// some validation
-		if !aDep.Enabled() {
-			if ctx.AConfig().AllowMissingDependencies() {
-				ctx.AddMissingDependencies([]string{depName})
-			} else {
-				ctx.ModuleErrorf("depends on disabled module %q", depName)
-			}
-			return
-		}
-		if aDep.Target().Os != ctx.Os() {
+		if dep.Target().Os != ctx.Os() {
 			ctx.ModuleErrorf("OS mismatch between %q and %q", ctx.ModuleName(), depName)
 			return
 		}
-		if aDep.Target().Arch.ArchType != ctx.Arch().ArchType {
+		if dep.Target().Arch.ArchType != ctx.Arch().ArchType {
 			ctx.ModuleErrorf("Arch mismatch between %q and %q", ctx.ModuleName(), depName)
 			return
 		}
diff --git a/cc/coverage.go b/cc/coverage.go
index 0b4188f..d2eede2 100644
--- a/cc/coverage.go
+++ b/cc/coverage.go
@@ -16,8 +16,6 @@
 
 import (
 	"android/soong/android"
-
-	"github.com/google/blueprint"
 )
 
 type CoverageProperties struct {
@@ -61,7 +59,7 @@
 			// For static libraries, the only thing that changes our object files
 			// are included whole static libraries, so check to see if any of
 			// those have coverage enabled.
-			ctx.VisitDirectDeps(func(m blueprint.Module) {
+			ctx.VisitDirectDeps(func(m android.Module) {
 				if ctx.OtherModuleDependencyTag(m) != wholeStaticDepTag {
 					return
 				}
@@ -75,7 +73,7 @@
 		} else {
 			// For executables and shared libraries, we need to check all of
 			// our static dependencies.
-			ctx.VisitDirectDeps(func(m blueprint.Module) {
+			ctx.VisitDirectDeps(func(m android.Module) {
 				cc, ok := m.(*Module)
 				if !ok || cc.coverage == nil {
 					return
diff --git a/cc/lto.go b/cc/lto.go
index 6a5ecde..fdb7688 100644
--- a/cc/lto.go
+++ b/cc/lto.go
@@ -15,8 +15,6 @@
 package cc
 
 import (
-	"github.com/google/blueprint"
-
 	"android/soong/android"
 )
 
@@ -104,7 +102,7 @@
 			mctx.PropertyErrorf("LTO", "FullLTO and ThinLTO are mutually exclusive")
 		}
 
-		mctx.VisitDepsDepthFirst(func(m blueprint.Module) {
+		mctx.VisitDepsDepthFirst(func(m android.Module) {
 			tag := mctx.OtherModuleDependencyTag(m)
 			switch tag {
 			case staticDepTag, staticExportDepTag, lateStaticDepTag, wholeStaticDepTag, objDepTag, reuseObjTag:
diff --git a/cc/sabi.go b/cc/sabi.go
index 8086f5b..ec1d246 100644
--- a/cc/sabi.go
+++ b/cc/sabi.go
@@ -17,8 +17,6 @@
 import (
 	"strings"
 
-	"github.com/google/blueprint"
-
 	"android/soong/android"
 	"android/soong/cc/config"
 )
@@ -81,7 +79,7 @@
 	if c, ok := mctx.Module().(*Module); ok &&
 		((c.isVndk() && c.useVndk()) || inList(c.Name(), llndkLibraries) ||
 			(c.sabi != nil && c.sabi.Properties.CreateSAbiDumps)) {
-		mctx.VisitDirectDeps(func(m blueprint.Module) {
+		mctx.VisitDirectDeps(func(m android.Module) {
 			tag := mctx.OtherModuleDependencyTag(m)
 			switch tag {
 			case staticDepTag, staticExportDepTag, lateStaticDepTag, wholeStaticDepTag:
diff --git a/cc/sanitize.go b/cc/sanitize.go
index 74f4bdb..d5535cb 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -19,8 +19,6 @@
 	"io"
 	"strings"
 
-	"github.com/google/blueprint"
-
 	"android/soong/android"
 	"android/soong/cc/config"
 )
@@ -493,7 +491,7 @@
 func sanitizerDepsMutator(t sanitizerType) func(android.TopDownMutatorContext) {
 	return func(mctx android.TopDownMutatorContext) {
 		if c, ok := mctx.Module().(*Module); ok && c.sanitize.Sanitizer(t) {
-			mctx.VisitDepsDepthFirst(func(module blueprint.Module) {
+			mctx.VisitDepsDepthFirst(func(module android.Module) {
 				if d, ok := mctx.Module().(*Module); ok && c.sanitize != nil &&
 					!c.sanitize.Properties.Sanitize.Never {
 					d.sanitize.Properties.SanitizeDep = true