Use VisitDirectDepsProxy in checkStaticExecutables.

Bug: 377723687
Test: Check the ninja and mk files.
Change-Id: I1c12fcabc7b389a85ffede0f9a03fdaeb92f1f5d
diff --git a/apex/apex.go b/apex/apex.go
index 3e1b41d..5407635 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -2742,12 +2742,12 @@
 
 // checkStaticExecutable ensures that executables in an APEX are not static.
 func (a *apexBundle) checkStaticExecutables(ctx android.ModuleContext) {
-	ctx.VisitDirectDeps(func(module android.Module) {
+	ctx.VisitDirectDepsProxy(func(module android.ModuleProxy) {
 		if ctx.OtherModuleDependencyTag(module) != executableTag {
 			return
 		}
 
-		if l, ok := module.(cc.LinkableInterface); ok && l.StaticExecutable() {
+		if android.OtherModuleProviderOrDefault(ctx, module, cc.LinkableInfoKey).StaticExecutable {
 			apex := a.ApexVariationName()
 			exec := ctx.OtherModuleName(module)
 			if isStaticExecutableAllowed(apex, exec) {