Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 384250c7 authored by Sorin Basca's avatar Sorin Basca Committed by Gerrit Code Review
Browse files

Revert "Target Java 17"

This reverts commit d6be9e51.

Reason for revert: b/267608166.

Change-Id: Ie07caa5ace3bcb290829e6fa476c5e1d47b975ba
Fixed: 267608166
parent d6be9e51
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -723,6 +723,10 @@ func (c *config) IsEnvFalse(key string) bool {
	return value == "0" || value == "n" || value == "no" || value == "off" || value == "false"
}

func (c *config) TargetsJava17() bool {
	return c.IsEnvTrue("EXPERIMENTAL_TARGET_JAVA_VERSION_17")
}

// EnvDeps returns the environment variables this build depends on. The first
// call to this function blocks future reads from the environment.
func (c *config) EnvDeps() map[string]string {
+7 −1
Original line number Diff line number Diff line
@@ -510,8 +510,14 @@ func getJavaVersion(ctx android.ModuleContext, javaVersion string, sdkContext an
		return normalizeJavaVersion(ctx, javaVersion)
	} else if ctx.Device() {
		return defaultJavaLanguageVersion(ctx, sdkContext.SdkVersion(ctx))
	} else {
	} else if ctx.Config().TargetsJava17() {
		// Temporary experimental flag to be able to try and build with
		// java version 17 options.  The flag, if used, just sets Java
		// 17 as the default version, leaving any components that
		// target an older version intact.
		return JAVA_VERSION_17
	} else {
		return JAVA_VERSION_11
	}
}

+7 −3
Original line number Diff line number Diff line
@@ -57,10 +57,14 @@ func defaultJavaLanguageVersion(ctx android.EarlyModuleContext, s android.SdkSpe
		return JAVA_VERSION_8
	} else if sdk.FinalOrFutureInt() <= 31 {
		return JAVA_VERSION_9
	} else if sdk.FinalOrFutureInt() <= 32 {
		return JAVA_VERSION_11
	} else {
	} else if ctx.Config().TargetsJava17() {
		// Temporary experimental flag to be able to try and build with
		// java version 17 options.  The flag, if used, just sets Java
		// 17 as the default version, leaving any components that
		// target an older version intact.
		return JAVA_VERSION_17
	} else {
		return JAVA_VERSION_11
	}
}