Add subdir to GenPath

We were emulating this for proto files, standardize it and make the
other generators use it as well.

Test: Compare out/soong/build.ninja before/after change
Test: mmma -j system/tools/hidl
Change-Id: I1888c7b981749060a398387bbb9b481270bf6d75
diff --git a/java/gen.go b/java/gen.go
index 52a0c79..0624708 100644
--- a/java/gen.go
+++ b/java/gen.go
@@ -57,7 +57,7 @@
 )
 
 func genAidl(ctx android.ModuleContext, aidlFile android.Path, aidlFlags string) android.Path {
-	javaFile := android.GenPathWithExt(ctx, aidlFile, "java")
+	javaFile := android.GenPathWithExt(ctx, "aidl", aidlFile, "java")
 	depFile := javaFile.String() + ".d"
 
 	ctx.ModuleBuild(pctx, android.ModuleBuildParams{
@@ -74,7 +74,7 @@
 }
 
 func genLogtags(ctx android.ModuleContext, logtagsFile android.Path) android.Path {
-	javaFile := android.GenPathWithExt(ctx, logtagsFile, "java")
+	javaFile := android.GenPathWithExt(ctx, "logtags", logtagsFile, "java")
 
 	ctx.ModuleBuild(pctx, android.ModuleBuildParams{
 		Rule:   logtags,