Unwrap ModuleProxy pointers

GetDirectDepProxyWithTag returns a *ModuleProxy. Update getWrappedModule
to unwrap *ModuleProxy instances in addition to ModuleProxy so that
GetDirectDepProxyWithTag can be a drop-in replacement for
GetDirectDepWithTag. I think we should also consider not exposing
ModuleProxy to users directly, and instead only expose it via the Module
interface.

Bug: 377723687
Test: m nothing
Change-Id: I188105a4638090d53e2821d86c2738bfdafe5217
diff --git a/android/base_module_context.go b/android/base_module_context.go
index d8558d0..4b90083 100644
--- a/android/base_module_context.go
+++ b/android/base_module_context.go
@@ -254,6 +254,9 @@
 }
 
 func getWrappedModule(module blueprint.Module) blueprint.Module {
+	if mp, isProxy := module.(*ModuleProxy); isProxy {
+		return mp.module
+	}
 	if mp, isProxy := module.(ModuleProxy); isProxy {
 		return mp.module
 	}
@@ -291,7 +294,7 @@
 }
 
 func (b *baseModuleContext) otherModuleProvider(m blueprint.Module, provider blueprint.AnyProviderKey) (any, bool) {
-	return b.bp.OtherModuleProvider(m, provider)
+	return b.bp.OtherModuleProvider(getWrappedModule(m), provider)
 }
 
 func (b *baseModuleContext) OtherModuleIsAutoGenerated(m blueprint.Module) bool {