Reapply "Remove unassigned event log tags feature"

.logtags files are a mapping of an integer -> name. However, there
is an unused feature where you could put a '?' instead of an integer,
and then the build system would assign a number to it, taking care
to avoid all other already-assigned numbers across the source tree.

This feature makes it hard to support some things we're working towards,
like incremental soong and treble common system images, so remove it.

Also modernize the python scripts a little.

The additions since the revert are the cleanups from aosp/3403019, and
removing a missed reference to all-event-log-tags.txt in java.mk.

This reverts commit 078347368de279b41a37b3599e24e60014892fef.

Bug: 382515940
Test: m event-log-tags
Change-Id: I8f08f3286f1275083e2074948f2feb39219f3687
diff --git a/android/logtags.go b/android/logtags.go
index 7929057..1e92dad 100644
--- a/android/logtags.go
+++ b/android/logtags.go
@@ -16,41 +16,8 @@
 
 import "github.com/google/blueprint"
 
-func init() {
-	RegisterParallelSingletonType("logtags", LogtagsSingleton)
-}
-
 type LogtagsInfo struct {
 	Logtags Paths
 }
 
 var LogtagsProviderKey = blueprint.NewProvider[*LogtagsInfo]()
-
-func LogtagsSingleton() Singleton {
-	return &logtagsSingleton{}
-}
-
-type logtagsSingleton struct{}
-
-func MergedLogtagsPath(ctx PathContext) OutputPath {
-	return PathForIntermediates(ctx, "all-event-log-tags.txt")
-}
-
-func (l *logtagsSingleton) GenerateBuildActions(ctx SingletonContext) {
-	var allLogtags Paths
-	ctx.VisitAllModules(func(module Module) {
-		if !module.ExportedToMake() {
-			return
-		}
-		if logtagsInfo, ok := OtherModuleProvider(ctx, module, LogtagsProviderKey); ok {
-			allLogtags = append(allLogtags, logtagsInfo.Logtags...)
-		}
-	})
-
-	builder := NewRuleBuilder(pctx, ctx)
-	builder.Command().
-		BuiltTool("merge-event-log-tags").
-		FlagWithOutput("-o ", MergedLogtagsPath(ctx)).
-		Inputs(SortedUniquePaths(allLogtags))
-	builder.Build("all-event-log-tags.txt", "merge logtags")
-}
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index 81afd02..9ad2cc9 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -882,8 +882,7 @@
 	eventLogtagsPath := etcPath.Join(ctx, "event-log-tags")
 	builder.Command().Text("mkdir").Flag("-p").Text(etcPath.String())
 	cmd := builder.Command().BuiltTool("merge-event-log-tags").
-		FlagWithArg("-o ", eventLogtagsPath.String()).
-		FlagWithInput("-m ", android.MergedLogtagsPath(ctx))
+		FlagWithArg("-o ", eventLogtagsPath.String())
 
 	for _, path := range android.SortedKeys(logtagsFilePaths) {
 		cmd.Text(path)
diff --git a/java/gen.go b/java/gen.go
index 1b4f4c7..aab8418 100644
--- a/java/gen.go
+++ b/java/gen.go
@@ -26,15 +26,14 @@
 )
 
 func init() {
-	pctx.SourcePathVariable("logtagsCmd", "build/make/tools/java-event-log-tags.py")
-	pctx.SourcePathVariable("logtagsLib", "build/make/tools/event_log_tags.py")
+	pctx.HostBinToolVariable("logtagsCmd", "java-event-log-tags")
 }
 
 var (
 	logtags = pctx.AndroidStaticRule("logtags",
 		blueprint.RuleParams{
 			Command:     "$logtagsCmd -o $out $in",
-			CommandDeps: []string{"$logtagsCmd", "$logtagsLib"},
+			CommandDeps: []string{"$logtagsCmd"},
 		})
 )