aboutsummaryrefslogtreecommitdiffstats
path: root/java/hiddenapi_singleton.go
diff options
context:
space:
mode:
Diffstat (limited to 'java/hiddenapi_singleton.go')
-rw-r--r--java/hiddenapi_singleton.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/java/hiddenapi_singleton.go b/java/hiddenapi_singleton.go
index 23f6cb0e..ceafb59e 100644
--- a/java/hiddenapi_singleton.go
+++ b/java/hiddenapi_singleton.go
@@ -89,7 +89,13 @@ func stubFlagsRule(ctx android.SingletonContext) {
// Public API stubs
publicStubModules := []string{
"android_stubs_current",
- "android.test.base.stubs",
+ }
+
+ // Add the android.test.base to the set of stubs only if the android.test.base module is on
+ // the boot jars list as the runtime will only enforce hiddenapi access against modules on
+ // that list.
+ if inList("android.test.base", ctx.Config().BootJars()) {
+ publicStubModules = append(publicStubModules, "android.test.base.stubs")
}
// System API stubs