Use OutputFilesProvider on aidl_interfaces_metadata am: e6601e5e3e

Original change: https://android-review.googlesource.com/c/platform/system/tools/aidl/+/3125158

Change-Id: Ic3d71b692d2eb18db01914dbc9e7631bb953ad8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/build/aidl_interface_metadata_singleton.go b/build/aidl_interface_metadata_singleton.go
index cab183a..87fdca4 100644
--- a/build/aidl_interface_metadata_singleton.go
+++ b/build/aidl_interface_metadata_singleton.go
@@ -17,7 +17,6 @@
 import (
 	"android/soong/android"
 
-	"fmt"
 	"strings"
 
 	"github.com/google/blueprint"
@@ -68,12 +67,8 @@
 
 type aidlInterfacesMetadataSingleton struct {
 	android.ModuleBase
-
-	metadataPath android.WritablePath
 }
 
-var _ android.OutputFileProducer = (*aidlInterfacesMetadataSingleton)(nil)
-
 func (m *aidlInterfacesMetadataSingleton) GenerateAndroidBuildActions(ctx android.ModuleContext) {
 	if m.Name() != aidlMetadataSingletonName {
 		ctx.PropertyErrorf("name", "must be %s", aidlMetadataSingletonName)
@@ -163,22 +158,16 @@
 		})
 	}
 
-	m.metadataPath = android.PathForModuleOut(ctx, "aidl_metadata.json")
+	output := android.PathForModuleOut(ctx, "aidl_metadata.json")
 
 	ctx.Build(pctx, android.BuildParams{
 		Rule:   joinJsonObjectsToArrayRule,
 		Inputs: metadataOutputs,
-		Output: m.metadataPath,
+		Output: output,
 		Args: map[string]string{
 			"files": strings.Join(metadataOutputs.Strings(), " "),
 		},
 	})
-}
 
-func (m *aidlInterfacesMetadataSingleton) OutputFiles(tag string) (android.Paths, error) {
-	if tag != "" {
-		return nil, fmt.Errorf("unsupported tag %q", tag)
-	}
-
-	return android.Paths{m.metadataPath}, nil
+	ctx.SetOutputFiles(android.Paths{output}, "")
 }