Merge "Add hidden_api for java_import"

This commit is contained in:
Liz Kammer
2020-09-14 13:57:09 +00:00
committed by Gerrit Code Review
7 changed files with 164 additions and 1 deletions

View File

@@ -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
}
}