Export aidl, proto and sysprop generated headers separately

Previously, a cc library that included .aidl, .proto and/or .sysprop
files and exported headers generated from at least one of those types
would actually export generated headers from all of them.

While headers generated from .sysprop files are always exported those
generated from .aidl or .proto should only be exported when explicitly
requested.

This change treats them separately as expected. It has the potential
to break the build as it could reduce the set of headers exported and
so a dependent module that needed those would break. The fix in that
case is to simply add one (or both) of the following to the module
that previously exported those headers:

  aidl: {
    export_aidl_headers: true,
  }

  proto: {
    export_proto_headers: true,
  }

Bug: 180712399
Test: m droid
Change-Id: I488182e27dd423d261443612f98d5c112dd3ef8f
diff --git a/cc/compiler.go b/cc/compiler.go
index 5f30d3d..e96295c 100644
--- a/cc/compiler.go
+++ b/cc/compiler.go
@@ -230,6 +230,8 @@
 	// other modules and filegroups. May include source files that have not yet been translated to
 	// C/C++ (.aidl, .proto, etc.)
 	srcsBeforeGen android.Paths
+
+	generatedSourceInfo
 }
 
 var _ compiler = (*baseCompiler)(nil)
@@ -634,10 +636,11 @@
 
 	srcs := append(android.Paths(nil), compiler.srcsBeforeGen...)
 
-	srcs, genDeps := genSources(ctx, srcs, buildFlags)
+	srcs, genDeps, info := genSources(ctx, srcs, buildFlags)
 	pathDeps = append(pathDeps, genDeps...)
 
 	compiler.pathDeps = pathDeps
+	compiler.generatedSourceInfo = info
 	compiler.cFlagsDeps = flags.CFlagsDeps
 
 	// Save src, buildFlags and context