aboutsummaryrefslogtreecommitdiffstats
path: root/java/hiddenapi.go
diff options
context:
space:
mode:
authorPaul Duffin <paulduffin@google.com>2019-02-27 12:37:45 +0000
committerPaul Duffin <paulduffin@google.com>2019-02-27 12:49:21 +0000
commitc02e834ad6c3a46423e50322b034b4097462c337 (patch)
treea9aa0215354dc11ef1100a60b50f5f2fbb3d383c /java/hiddenapi.go
parent6bd446620c663de2aba60f1dde554e8ebca39f6a (diff)
downloadandroid_build_soong-c02e834ad6c3a46423e50322b034b4097462c337.tar.gz
android_build_soong-c02e834ad6c3a46423e50322b034b4097462c337.tar.bz2
android_build_soong-c02e834ad6c3a46423e50322b034b4097462c337.zip
Revert "Support libraries (not just boot jars) that have hiddenapi"
This reverts commit e5b5657f875be27cc8f8fcf3a1e6fa814d794c95. The reverted change was added in order to gather the information about the hiddenapi that is needed for the runtime to enforce the hiddenapi accessibility rules. Without it the build broke with the following error when the android.test.base library was not in the PRODUCT_BOOT_JARS list: AssertionError: Error processing: frameworks/base/config/hiddenapi-greylist.txt The following entries were unexpected: Ljunit/framework/TestSuite;->isPublicTestMethod(Ljava/lang/reflect/Method;)Z Landroid/test/AndroidTestCase;->setTestContext(Landroid/content/Context;)V Landroid/test/InstrumentationTestCase;->runMethod(Ljava/lang/reflect/Method;I)V Landroid/test/AndroidTestCase;->getTestContext()Landroid/content/Context; Ljunit/framework/TestCase;->fName:Ljava/lang/String; Ljunit/framework/TestSuite;->isTestMethod(Ljava/lang/reflect/Method;)Z Please visit go/hiddenapi for more information. However, it turns out that the runtime does not currently enforce access to the hiddenapi of libraries that are not on the PRODUCT_BOOT_JARS list. Gathering hiddenapi information for a library not on the PRODUCT_BOOT_JARS list breaks the CtsHiddenApiBlacklistApi27TestCases and CtsHiddenApiBlacklistApi28TestCases test modules which use that information to ensure that correct runtime behavior. This change is being reverted simply because it does not work. Bug: 126519737 Bug: 73711752 Test: make REMOVE_ATB_FROM_BCP=true droid and make droid Change-Id: I1b4a7786b1061effa0e2d37832afa8570953a06e
Diffstat (limited to 'java/hiddenapi.go')
-rw-r--r--java/hiddenapi.go14
1 files changed, 2 insertions, 12 deletions
diff --git a/java/hiddenapi.go b/java/hiddenapi.go
index 104cd767..51ed3dda 100644
--- a/java/hiddenapi.go
+++ b/java/hiddenapi.go
@@ -57,14 +57,7 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, dexJar android.ModuleOu
if !ctx.Config().IsEnvTrue("UNSAFE_DISABLE_HIDDENAPI_FLAGS") {
isBootJar := inList(ctx.ModuleName(), ctx.Config().BootJars())
- // Check to see if this module provides part of the hiddenapi, i.e. is a boot jar or a white listed
- // library.
- isProvidingJar := isBootJar || inList(ctx.ModuleName(), config.HiddenAPIProvidingNonBootJars)
-
- // If this module provides part of the hiddenapi or is a special module that simply provides information
- // about the hiddenapi then extract information about the hiddenapi from the UnsupportedAppUsage
- // annotations compiled into the classes.jar.
- if isProvidingJar || inList(ctx.ModuleName(), config.HiddenAPIExtraAppUsageJars) {
+ if isBootJar || inList(ctx.ModuleName(), config.HiddenAPIExtraAppUsageJars) {
// Derive the greylist from classes jar.
flagsCSV := android.PathForModuleOut(ctx, "hiddenapi", "flags.csv")
metadataCSV := android.PathForModuleOut(ctx, "hiddenapi", "metadata.csv")
@@ -72,10 +65,7 @@ func (h *hiddenAPI) hiddenAPI(ctx android.ModuleContext, dexJar android.ModuleOu
h.flagsCSVPath = flagsCSV
h.metadataCSVPath = metadataCSV
}
-
- // If this module provides part of the hiddenapi then encode the information about the hiddenapi into
- // the dex file created for this module.
- if isProvidingJar {
+ if isBootJar {
hiddenAPIJar := android.PathForModuleOut(ctx, "hiddenapi", ctx.ModuleName()+".jar")
h.bootDexJarPath = dexJar
hiddenAPIEncodeDex(ctx, hiddenAPIJar, dexJar, uncompressDex)