Convert ndkSingleton, apexDepsInfoSingleton, allTeamsSingleton,
apexPrebuiltInfo to use ModuleProxy.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I77b05e8b54843bfa8b91376a6796c2b5c69be3c1
diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go
index 7481954..6e26d4c 100644
--- a/cc/ndk_headers.go
+++ b/cc/ndk_headers.go
@@ -80,6 +80,20 @@
 	licensePath  android.Path
 }
 
+type NdkHeaderInfo struct {
+	SrcPaths     android.Paths
+	InstallPaths android.Paths
+	LicensePath  android.Path
+	// Set to true if the headers installed by this module should skip
+	// verification. This step ensures that each header is self-contained (can
+	// be #included alone) and is valid C. This should not be disabled except in
+	// rare cases. Outside bionic and external, if you're using this option
+	// you've probably made a mistake.
+	SkipVerification bool
+}
+
+var NdkHeaderInfoProvider = blueprint.NewProvider[NdkHeaderInfo]()
+
 func getHeaderInstallDir(ctx android.ModuleContext, header android.Path, from string,
 	to string) android.OutputPath {
 	// Output path is the sysroot base + "usr/include" + to directory + directory component
@@ -135,6 +149,13 @@
 	if len(m.installPaths) == 0 {
 		ctx.ModuleErrorf("srcs %q matched zero files", m.properties.Srcs)
 	}
+
+	android.SetProvider(ctx, NdkHeaderInfoProvider, NdkHeaderInfo{
+		SrcPaths:         m.srcPaths,
+		InstallPaths:     m.installPaths,
+		LicensePath:      m.licensePath,
+		SkipVerification: Bool(m.properties.Skip_verification),
+	})
 }
 
 // ndk_headers installs the sets of ndk headers defined in the srcs property
@@ -203,6 +224,8 @@
 	licensePath  android.Path
 }
 
+var NdkPreprocessedHeaderInfoProvider = blueprint.NewProvider[NdkHeaderInfo]()
+
 func (m *preprocessedHeadersModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	if String(m.properties.License) == "" {
 		ctx.PropertyErrorf("license", "field is required")
@@ -231,6 +254,13 @@
 	if len(m.installPaths) == 0 {
 		ctx.ModuleErrorf("srcs %q matched zero files", m.properties.Srcs)
 	}
+
+	android.SetProvider(ctx, NdkPreprocessedHeaderInfoProvider, NdkHeaderInfo{
+		SrcPaths:         m.srcPaths,
+		InstallPaths:     m.installPaths,
+		LicensePath:      m.licensePath,
+		SkipVerification: Bool(m.properties.Skip_verification),
+	})
 }
 
 // preprocessed_ndk_headers preprocesses all the ndk headers listed in the srcs