Change depVisitor to use providers instead of type-asserting to
interfaces directly, the next step is to change it to use ModuleProxy
once IsDepInSameApex is ready.

Bug: 377723687
Test: Unit tests and compare the ninja and mk files generated.
Change-Id: I13a4e256a26dbf7f9b3b746d628ac8f68b4e598e
diff --git a/bpf/bpf.go b/bpf/bpf.go
index 3f34382..deb465d 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -60,6 +60,12 @@
 	ctx.RegisterModuleType("bpf", BpfFactory)
 }
 
+type BpfInfo struct {
+	SubDir string
+}
+
+var BpfInfoProvider = blueprint.NewProvider[BpfInfo]()
+
 var PrepareForTestWithBpf = android.FixtureRegisterWithContext(registerBpfBuildComponents)
 
 // BpfModule interface is used by the apex package to gather information from a bpf module.
@@ -230,6 +236,10 @@
 		ctx.PackageFile(installDir, obj.Base(), obj)
 	}
 
+	android.SetProvider(ctx, BpfInfoProvider, BpfInfo{
+		SubDir: bpf.SubDir(),
+	})
+
 	ctx.SetOutputFiles(bpf.objs, "")
 }