Fix using aidl files from filegroups

Compute sources including from filegroup and genrule dependencies
before determining if any sources will cause flags to be added.

Test: gen_test.go
Change-Id: I0434b003bbda07a58bb2ce1a0a72997918c8fae2
diff --git a/cc/cc.go b/cc/cc.go
index 86a60c9..384b240 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -230,7 +230,7 @@
 type compiler interface {
 	compilerInit(ctx BaseModuleContext)
 	compilerDeps(ctx DepsContext, deps Deps) Deps
-	compilerFlags(ctx ModuleContext, flags Flags) Flags
+	compilerFlags(ctx ModuleContext, flags Flags, deps PathDeps) Flags
 	compilerProps() []interface{}
 
 	appendCflags([]string)
@@ -589,12 +589,17 @@
 	}
 	ctx.ctx = ctx
 
+	deps := c.depsToPaths(ctx)
+	if ctx.Failed() {
+		return
+	}
+
 	flags := Flags{
 		Toolchain: c.toolchain(ctx),
 		Clang:     c.clang(ctx),
 	}
 	if c.compiler != nil {
-		flags = c.compiler.compilerFlags(ctx, flags)
+		flags = c.compiler.compilerFlags(ctx, flags, deps)
 	}
 	if c.linker != nil {
 		flags = c.linker.linkerFlags(ctx, flags)
@@ -625,10 +630,6 @@
 	flags.CppFlags, _ = filterList(flags.CppFlags, config.IllegalFlags)
 	flags.ConlyFlags, _ = filterList(flags.ConlyFlags, config.IllegalFlags)
 
-	deps := c.depsToPaths(ctx)
-	if ctx.Failed() {
-		return
-	}
 	flags.GlobalFlags = append(flags.GlobalFlags, deps.Flags...)
 	c.flags = flags
 	// We need access to all the flags seen by a source file.