Convert ModuleProvder to generic providers API

Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
diff --git a/java/test_spec_test.go b/java/test_spec_test.go
index 1409b28..f628b4b 100644
--- a/java/test_spec_test.go
+++ b/java/test_spec_test.go
@@ -34,9 +34,7 @@
 	).Module().(*soongTesting.TestSpecModule)
 
 	// Check that the provider has the right contents
-	data := result.ModuleProvider(
-		module, soongTesting.TestSpecProviderKey,
-	).(soongTesting.TestSpecProviderData)
+	data, _ := android.SingletonModuleProvider(result, module, soongTesting.TestSpecProviderKey)
 	if !strings.HasSuffix(
 		data.IntermediatePath.String(), "/intermediateTestSpecMetadata.pb",
 	) {