Change depVisitor to use providers instead of type-asserting to
interfaces directly, the next step is to change it to use ModuleProxy
once IsDepInSameApex is ready.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I13a4e256a26dbf7f9b3b746d628ac8f68b4e598e
diff --git a/android/base_module_context.go b/android/base_module_context.go
index 4b90083..cdee96f 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -88,6 +88,11 @@
 	// This method shouldn't be used directly, prefer the type-safe android.OtherModuleProvider instead.
 	otherModuleProvider(m blueprint.Module, provider blueprint.AnyProviderKey) (any, bool)
 
+	// OtherModuleHasProvider returns true if the module has the given provider set. This
+	// can avoid copying the provider if the caller only cares about the existence of
+	// the provider.
+	OtherModuleHasProvider(m blueprint.Module, provider blueprint.AnyProviderKey) bool
+
 	// OtherModuleIsAutoGenerated returns true if the module is auto generated by another module
 	// instead of being defined in Android.bp file.
 	OtherModuleIsAutoGenerated(m blueprint.Module) bool
@@ -297,6 +302,10 @@
 	return b.bp.OtherModuleProvider(getWrappedModule(m), provider)
 }
 
+func (b *baseModuleContext) OtherModuleHasProvider(m blueprint.Module, provider blueprint.AnyProviderKey) bool {
+	return b.bp.OtherModuleHasProvider(getWrappedModule(m), provider)
+}
+
 func (b *baseModuleContext) OtherModuleIsAutoGenerated(m blueprint.Module) bool {
 	return b.bp.OtherModuleIsAutoGenerated(m)
 }