summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
author Liz Kammer <eakammer@google.com> 2020-09-14 13:57:09 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2020-09-14 13:57:09 +0000
commit88d593d942c33045af20fadc6c700d42d5f85177 (patch)
treee574198d085d1ac6642f156b8b03751ba31a40ff /java/java.go
parent8eebee43850bbe287de4e0f0ec2e590c43b4f380 (diff)
parent5ca3a6293e6efe1750f1a558c503d3dfccceae31 (diff)
Merge "Add hidden_api for java_import"
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index 82518c9db..d67e9e098 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1614,6 +1614,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,
@@ -2684,6 +2687,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
}
}