Avoid targeting Java 9 for targets with SDK version up to 29.

Targets with sdk_version values up to and including 29 should not use
Java language level 9, even if EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true
is set.

This change fixes a downstream issue.

Bug: 131678633
Test: EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true make droid tests docs cts java
Test: (same test in downstream branch)
Change-Id: Ic58e8df2e06d6e07bc42255314521831dc41b239
This commit is contained in:
Pete Gillin 2019-05-20 15:44:53 +01:00
parent 42e862c56d
commit 9c64014102
1 changed files with 1 additions and 1 deletions

View File

@ -854,7 +854,7 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext sd
ret = javaVersion ret = javaVersion
} else if ctx.Device() && sdk <= 23 { } else if ctx.Device() && sdk <= 23 {
ret = "1.7" ret = "1.7"
} else if ctx.Device() && sdk <= 28 || !ctx.Config().TargetOpenJDK9() { } else if ctx.Device() && sdk <= 29 || !ctx.Config().TargetOpenJDK9() {
ret = "1.8" ret = "1.8"
} else if ctx.Device() && sdkContext.sdkVersion() != "" && sdk == android.FutureApiLevel { } else if ctx.Device() && sdkContext.sdkVersion() != "" && sdk == android.FutureApiLevel {
// TODO(ccross): once we generate stubs we should be able to use 1.9 for sdk_version: "current" // TODO(ccross): once we generate stubs we should be able to use 1.9 for sdk_version: "current"