summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2019-12-17 06:02:05 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-12-17 06:02:05 +0000
commit7cf4b5de6b2d754e48aadeeeec0dc01b26264ee0 (patch)
tree43301e129e2aeed4ac3ad3a064755c36707b82a4 /java/java.go
parent1d1a9207949791ed1267ac81266e64ad5c415635 (diff)
parentb02bb40f334751dd9f30bb12ad8843f9e9932895 (diff)
Merge "hostdex:true modules are available for platform"
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))