summaryrefslogtreecommitdiff
path: root/cc/gen.go
diff options
context:
space:
mode:
Diffstat (limited to 'cc/gen.go')
-rw-r--r--cc/gen.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cc/gen.go b/cc/gen.go
index 42b0cbe1a..17ab45fc8 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -113,7 +113,14 @@ func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile andr
aidlPackage := strings.TrimSuffix(aidlFile.Rel(), aidlFile.Base())
baseName := strings.TrimSuffix(aidlFile.Base(), aidlFile.Ext())
- shortName := strings.TrimPrefix(baseName, "I")
+ shortName := baseName
+ // TODO(b/111362593): aidl_to_cpp_common.cpp uses heuristics to figure out if
+ // an interface name has a leading I. Those same heuristics have been
+ // moved here.
+ if len(baseName) >= 2 && baseName[0] == 'I' &&
+ strings.ToUpper(baseName)[1] == baseName[1] {
+ shortName = strings.TrimPrefix(baseName, "I")
+ }
outDir := android.PathForModuleGen(ctx, "aidl")
headerI := outDir.Join(ctx, aidlPackage, baseName+".h")