diff options
author | Liz Kammer <eakammer@google.com> | 2020-08-05 15:40:41 -0700 |
---|---|---|
committer | Liz Kammer <eakammer@google.com> | 2020-09-10 07:56:03 -0700 |
commit | 5ca3a6293e6efe1750f1a558c503d3dfccceae31 (patch) | |
tree | ab0c72c63668f2c3c14fe5c375d2e8d55a8fe92f /java/java.go | |
parent | 3e0b9c031caa7f004330d780d9d4631df3ee4bb3 (diff) |
Add hidden_api for java_import
Test: go java tests
Test: m
Bug: 160455085
Change-Id: Ib6e826e32ca73ceea0799b26145ad06b1e62a1bf
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index eb8841732..236267652 100644 --- a/java/java.go +++ b/java/java.go @@ -1611,6 +1611,9 @@ func (j *Module) compile(ctx android.ModuleContext, aaptSrcJar android.Path) { configurationName := j.ConfigurationName() primary := configurationName == ctx.ModuleName() + // If the prebuilt is being used rather than the from source, skip this + // module to prevent duplicated classes + primary = primary && !j.IsReplacedByPrebuilt() // Hidden API CSV generation and dex encoding dexOutputFile = j.hiddenAPI.hiddenAPI(ctx, configurationName, primary, dexOutputFile, j.implementationJarFile, @@ -2681,6 +2684,13 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { return } + configurationName := j.BaseModuleName() + primary := j.Prebuilt().UsePrebuilt() + + // Hidden API CSV generation and dex encoding + dexOutputFile = j.hiddenAPI.hiddenAPI(ctx, configurationName, primary, dexOutputFile, outputFile, + proptools.Bool(j.dexProperties.Uncompress_dex)) + j.dexJarFile = dexOutputFile } } |