Revert "Support filegroup in exclude_srcs"

This reverts commit f36a3d9b6da654bf8bd7a49315b1625cf0e774ce.

Reason for revert: Broke several builds. I'm acting build cop, reverting.

Bug: 70351683

Change-Id: I775ada4e9cb6473519d51420b41b818af163da44
diff --git a/android/module.go b/android/module.go
index 6f247ab..9de5294 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1176,24 +1176,15 @@
 func (ctx *androidModuleContext) ExpandSourcesSubDir(srcFiles, excludes []string, subDir string) Paths {
 	prefix := PathForModuleSrc(ctx).String()
 
-	expandedExcludes := make([]string, 0, len(excludes))
-
-	for _, e := range excludes {
-		if m := SrcIsModule(e); m != "" {
-			module := ctx.GetDirectDepWithTag(m, SourceDepTag)
-			if module == nil {
-				// Error will have been handled by ExtractSourcesDeps
-				continue
-			}
-			if srcProducer, ok := module.(SourceFileProducer); ok {
-				expandedExcludes = append(expandedExcludes, srcProducer.Srcs().Strings()...)
-			} else {
-				ctx.ModuleErrorf("srcs dependency %q is not a source file producing module", m)
-			}
-		} else {
-			expandedExcludes = append(expandedExcludes, filepath.Join(prefix, e))
+	for i, e := range excludes {
+		j := findStringInSlice(e, srcFiles)
+		if j != -1 {
+			srcFiles = append(srcFiles[:j], srcFiles[j+1:]...)
 		}
+
+		excludes[i] = filepath.Join(prefix, e)
 	}
+
 	expandedSrcFiles := make(Paths, 0, len(srcFiles))
 	for _, s := range srcFiles {
 		if m := SrcIsModule(s); m != "" {
@@ -1203,33 +1194,22 @@
 				continue
 			}
 			if srcProducer, ok := module.(SourceFileProducer); ok {
-				moduleSrcs := srcProducer.Srcs()
-				for _, e := range expandedExcludes {
-					for j, ms := range moduleSrcs {
-						if ms.String() == e {
-							moduleSrcs = append(moduleSrcs[:j], moduleSrcs[j+1:]...)
-						}
-					}
-				}
-				expandedSrcFiles = append(expandedSrcFiles, moduleSrcs...)
+				expandedSrcFiles = append(expandedSrcFiles, srcProducer.Srcs()...)
 			} else {
 				ctx.ModuleErrorf("srcs dependency %q is not a source file producing module", m)
 			}
 		} else if pathtools.IsGlob(s) {
-			globbedSrcFiles := ctx.Glob(filepath.Join(prefix, s), expandedExcludes)
+			globbedSrcFiles := ctx.Glob(filepath.Join(prefix, s), excludes)
 			for i, s := range globbedSrcFiles {
 				globbedSrcFiles[i] = s.(ModuleSrcPath).WithSubDir(ctx, subDir)
 			}
 			expandedSrcFiles = append(expandedSrcFiles, globbedSrcFiles...)
 		} else {
-			p := PathForModuleSrc(ctx, s).WithSubDir(ctx, subDir)
-			j := findStringInSlice(p.String(), expandedExcludes)
-			if j == -1 {
-				expandedSrcFiles = append(expandedSrcFiles, p)
-			}
-
+			s := PathForModuleSrc(ctx, s).WithSubDir(ctx, subDir)
+			expandedSrcFiles = append(expandedSrcFiles, s)
 		}
 	}
+
 	return expandedSrcFiles
 }