Update outputFilesForModuleFromProvider

This CL includes following changes:
1. Added the ability to differentiate the cases that module never
   sets OutputFilesProvider and that module sets the provider with
   a nil value.
2. Updated GenerateTaggedDistFiles to use outputFilesForModuleFromProvider.
3. Updated on cc module to use OutputFilesProvider.

Test: CI
Bug: 339477385
Change-Id: Ib5663a947315f6a90a81b7f073cf8dd22fbb1e05
diff --git a/android/testing.go b/android/testing.go
index 8dd467d..18fd3b3 100644
--- a/android/testing.go
+++ b/android/testing.go
@@ -1025,9 +1025,12 @@
 // otherwise returns the result of calling Paths.RelativeToTop
 // on the returned Paths.
 func (m TestingModule) OutputFiles(t *testing.T, tag string) Paths {
-	// TODO: add non-empty-string tag case and remove OutputFileProducer part
-	if tag == "" && m.module.base().outputFiles.DefaultOutputFiles != nil {
-		return m.module.base().outputFiles.DefaultOutputFiles.RelativeToTop()
+	// TODO: remove OutputFileProducer part
+	outputFiles := m.Module().base().outputFiles
+	if tag == "" && outputFiles.DefaultOutputFiles != nil {
+		return outputFiles.DefaultOutputFiles.RelativeToTop()
+	} else if taggedOutputFiles, hasTag := outputFiles.TaggedOutputFiles[tag]; hasTag {
+		return taggedOutputFiles
 	}
 
 	producer, ok := m.module.(OutputFileProducer)