summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2019-12-03 00:43:57 +0900
committerJiyong Park <jiyong@google.com>2019-12-16 15:19:13 +0900
commitb02bb40f334751dd9f30bb12ad8843f9e9932895 (patch)
tree4bf7296556f72071c264eca9f50585fd69e2075a /java/java.go
parent2812df4edb6c22c6d5de2156942b1898db9c2317 (diff)
hostdex:true modules are available for platform
Java libraries with hostdex: true are available for the platform even if it doesn't have "//apex_available:platform" in the apex_available property. Note that the java libraries are still prevented from being installed to the device. Bug: 128708192 Test: m Change-Id: I6463ebc59cf7fd861b812999d7a79c387bbb3335
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/java/java.go b/java/java.go
index d8db5f8a4..59bfaf758 100644
--- a/java/java.go
+++ b/java/java.go
@@ -559,6 +559,16 @@ func (j *Module) targetSdkVersion() string {
return j.sdkVersion()
}
+func (j *Module) AvailableFor(what string) bool {
+ if what == android.AvailableToPlatform && Bool(j.deviceProperties.Hostdex) {
+ // Exception: for hostdex: true libraries, the platform variant is created
+ // even if it's not marked as available to platform. In that case, the platform
+ // variant is used only for the hostdex and not installed to the device.
+ return true
+ }
+ return j.ApexModuleBase.AvailableFor(what)
+}
+
func (j *Module) deps(ctx android.BottomUpMutatorContext) {
if ctx.Device() {
sdkDep := decodeSdkDep(ctx, sdkContext(j))