Convert CollectAllSharedDependencies to use ModuleProxy.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: Ie3b6d1f8fa684ab191123bd57645b86f3bfa97b4
diff --git a/cc/cc.go b/cc/cc.go
index 16471c9..21fd216 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -85,6 +85,7 @@
 	TestBinaryInfo         *TestBinaryInfo
 	BenchmarkDecoratorInfo *BenchmarkDecoratorInfo
 	ObjectLinkerInfo       *ObjectLinkerInfo
+	StubDecoratorInfo      *StubDecoratorInfo
 }
 
 type BinaryDecoratorInfo struct{}
@@ -101,8 +102,15 @@
 	Gtest bool
 }
 type BenchmarkDecoratorInfo struct{}
+
+type StubDecoratorInfo struct{}
+
 type ObjectLinkerInfo struct{}
 
+type LibraryInfo struct {
+	BuildStubs bool
+}
+
 // Common info about the cc module.
 type CcInfo struct {
 	IsPrebuilt             bool
@@ -110,6 +118,7 @@
 	CompilerInfo           *CompilerInfo
 	LinkerInfo             *LinkerInfo
 	SnapshotInfo           *SnapshotInfo
+	LibraryInfo            *LibraryInfo
 }
 
 var CcInfoProvider = blueprint.NewProvider[*CcInfo]()
@@ -126,6 +135,7 @@
 	OutputFile           android.OptionalPath
 	CoverageFiles        android.Paths
 	SAbiDumpFiles        android.Paths
+	CcLibrary            bool
 	CcLibraryInterface   bool
 	RustLibraryInterface bool
 	// CrateName returns the crateName for a Rust library
@@ -145,6 +155,7 @@
 	OnlyInVendorRamdisk bool
 	InRecovery          bool
 	OnlyInRecovery      bool
+	Installable         *bool
 }
 
 var LinkableInfoProvider = blueprint.NewProvider[*LinkableInfo]()
@@ -2214,6 +2225,7 @@
 	if c.linker != nil {
 		if library, ok := c.linker.(libraryInterface); ok {
 			linkableInfo.Static = library.static()
+			linkableInfo.Shared = library.shared()
 			linkableInfo.CoverageFiles = library.objs().coverageFiles
 			linkableInfo.SAbiDumpFiles = library.objs().sAbiDumpFiles
 		}
@@ -2264,6 +2276,8 @@
 			ccInfo.LinkerInfo.BenchmarkDecoratorInfo = &BenchmarkDecoratorInfo{}
 		case *objectLinker:
 			ccInfo.LinkerInfo.ObjectLinkerInfo = &ObjectLinkerInfo{}
+		case *stubDecorator:
+			ccInfo.LinkerInfo.StubDecoratorInfo = &StubDecoratorInfo{}
 		}
 
 		if s, ok := c.linker.(SnapshotInterface); ok {
@@ -2272,6 +2286,11 @@
 			}
 		}
 	}
+	if c.library != nil {
+		ccInfo.LibraryInfo = &LibraryInfo{
+			BuildStubs: c.library.buildStubs(),
+		}
+	}
 	android.SetProvider(ctx, CcInfoProvider, &ccInfo)
 
 	c.setOutputFiles(ctx)
@@ -2288,6 +2307,7 @@
 		OutputFile:           mod.OutputFile(),
 		UnstrippedOutputFile: mod.UnstrippedOutputFile(),
 		IsStubs:              mod.IsStubs(),
+		CcLibrary:            mod.CcLibrary(),
 		CcLibraryInterface:   mod.CcLibraryInterface(),
 		RustLibraryInterface: mod.RustLibraryInterface(),
 		BaseModuleName:       mod.BaseModuleName(),
@@ -2301,6 +2321,7 @@
 		OnlyInVendorRamdisk:  mod.OnlyInVendorRamdisk(),
 		InRecovery:           mod.InRecovery(),
 		OnlyInRecovery:       mod.OnlyInRecovery(),
+		Installable:          mod.Installable(),
 	}
 }