diff options
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go index 2ac5a5b46..49095ca36 100644 --- a/java/java.go +++ b/java/java.go @@ -1172,12 +1172,25 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.implementationAndResourcesJar = implementationAndResourcesJar if ctx.Device() && (Bool(j.properties.Installable) || Bool(j.deviceProperties.Compile_dex)) { + // Dex compilation var dexOutputFile android.ModuleOutPath dexOutputFile = j.compileDex(ctx, flags, outputFile, jarName) if ctx.Failed() { return } + // Hidden API CSV generation and dex encoding + isBootJar := inList(ctx.ModuleName(), ctx.Config().BootJars()) + if isBootJar || inList(ctx.ModuleName(), ctx.Config().HiddenAPIExtraAppUsageJars()) { + // Derive the greylist from classes jar. + hiddenAPIGenerateCSV(ctx, j.implementationJarFile) + } + if isBootJar { + hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", jarName) + hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexOutputFile) + dexOutputFile = hiddenAPIJar + } + // merge dex jar with resources if necessary if j.resourceJar != nil { jars := android.Paths{dexOutputFile, j.resourceJar} @@ -1189,6 +1202,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path j.dexJarFile = dexOutputFile + // Dexpreopting j.dexpreopter.isInstallable = Bool(j.properties.Installable) j.dexpreopter.uncompressedDex = j.deviceProperties.UncompressDex dexOutputFile = j.dexpreopt(ctx, dexOutputFile) |