Convert depsToPaths to use ModuleProxy for both cc and rust.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: Id465f293c3615fc803b34c990f19b4386ebece1c
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index 197a4b2..27a9f66 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -302,12 +302,11 @@
 		ctx.ModuleErrorf("Could not find implementation for stub: ")
 		return nil
 	}
-	info, ok := android.OtherModuleProvider(ctx, *dep, CcInfoProvider)
-	if !ok {
+	if _, ok := android.OtherModuleProvider(ctx, *dep, CcInfoProvider); !ok {
 		ctx.ModuleErrorf("Implementation for stub is not correct module type")
 		return nil
 	}
-	output := info.LinkerInfo.UnstrippedOutputFile
+	output := android.OtherModuleProviderOrDefault(ctx, *dep, LinkableInfoProvider).UnstrippedOutputFile
 	if output == nil {
 		ctx.ModuleErrorf("implementation module (%s) has no output", *dep)
 		return nil