diff options
author | David Brazdil <dbrazdil@google.com> | 2019-01-18 11:12:05 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2019-01-18 11:12:33 +0000 |
commit | 9fc36a68d0d0f260806b66e88bebefd778a5eb5c (patch) | |
tree | edec31ef184266ecc547bbc8bc3f04786988ff81 /java/java.go | |
parent | 77542038ebdf39285d178f9fe1967fbe516e32c1 (diff) |
Restore UNSAFE_DISABLE_HIDDENAPI_FLAGS functionality.
It got broken with the move to hiddenapi to Soong.
Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true m -j32
Change-Id: Id369bfae8e118907b1f12faa7e4207494904edda
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/java/java.go b/java/java.go index 49095ca36..209d0a703 100644 --- a/java/java.go +++ b/java/java.go @@ -1180,15 +1180,17 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path } // 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 + if !ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") { + 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 |