For modules that provide AndroidMkInfoProvider, only access modules'
internal data through providers.

Eventually all module should be converted to provide this provider, and
then we can change it to use VisitAllModuleProxies instead of
VisitAllModules.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I83b55c20f971c619fa39613c1fb1cb525f56d20e
diff --git a/android/testing.go b/android/testing.go
index fe9bcec..d0ede21 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -1191,10 +1191,11 @@
 
 	info := OtherModuleProviderOrDefault(ctx, mod, AndroidMkInfoProvider)
 	aconfigUpdateAndroidMkInfos(ctx, mod, info)
-	info.PrimaryInfo.fillInEntries(ctx, mod)
+	commonInfo, _ := OtherModuleProvider(ctx, mod, CommonModuleInfoKey)
+	info.PrimaryInfo.fillInEntries(ctx, mod, &commonInfo)
 	if len(info.ExtraInfo) > 0 {
 		for _, ei := range info.ExtraInfo {
-			ei.fillInEntries(ctx, mod)
+			ei.fillInEntries(ctx, mod, &commonInfo)
 		}
 	}