Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d3614e04 authored by Yu Liu's avatar Yu Liu
Browse files

Change CombinedApis to actually use WalkDepsProxy, also uses the newly

added AndroidLibraryDependencyInfo.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: Iad4013d3212e8f575dd55bcfec0e2b659ae0d8db
parent a9e2d996
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -102,8 +102,9 @@ func (a *CombinedApis) DepsMutator(ctx android.BottomUpMutatorContext) {
}
}


func (a *CombinedApis) GenerateAndroidBuildActions(ctx android.ModuleContext) {
func (a *CombinedApis) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	ctx.WalkDeps(func(child, parent android.Module) bool {
	ctx.WalkDepsProxy(func(child, parent android.ModuleProxy) bool {
		if _, ok := android.OtherModuleProvider(ctx, child, java.AndroidLibraryInfoProvider); ok && child.Name() != "framework-res" {
		javaInfo, ok := android.OtherModuleProvider(ctx, child, java.JavaInfoProvider)
		if ok && javaInfo.AndroidLibraryDependencyInfo != nil && child.Name() != "framework-res" {
			// Stubs of BCP and SSCP libraries should not have any dependencies on apps
			// Stubs of BCP and SSCP libraries should not have any dependencies on apps
			// This check ensures that we do not run into circular dependencies when UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true
			// This check ensures that we do not run into circular dependencies when UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true
			ctx.ModuleErrorf(
			ctx.ModuleErrorf(