Change CommonModuleInfoProvider to a pointer.

Bug: 358427516
Test: Manually verified genereated ninja and mk files, unit tests.
Change-Id: I53a6dd718232735decbeb93febfd269dd9449e86
diff --git a/java/java.go b/java/java.go
index 7f897a0..dd9f852 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2235,7 +2235,7 @@
 	// install these alongside the java binary.
 	ctx.VisitDirectDepsProxyWithTag(jniInstallTag, func(jni android.ModuleProxy) {
 		// Use the BaseModuleName of the dependency (without any prebuilt_ prefix)
-		commonInfo, _ := android.OtherModuleProvider(ctx, jni, android.CommonModuleInfoProvider)
+		commonInfo := android.OtherModulePointerProviderOrDefault(ctx, jni, android.CommonModuleInfoProvider)
 		j.androidMkNamesOfJniLibs = append(j.androidMkNamesOfJniLibs, commonInfo.BaseModuleName+":"+commonInfo.Target.Arch.ArchType.Bitness())
 	})
 	// Check that native libraries are not listed in `required`. Prompt users to use `jni_libs` instead.