lint: always run module specified in ANDROID_LINT_CHECK_EXTRA_MODULES

Before this change, ANDROID_LINT_EXTRA_CHECK_MODULES was only read if
ANDROID_LINT_CHECK was also set.  This change allows an entire module of
checks to be added to lint without having to specify all of the
individuals with ANDROID_LINT_CHECK.

This is part of a workaround to run some lint checks globally, but is
useful to provide more flexibility generally.

Bug: 236558918
Test: manually tested with AndroidFrameworkLintChecker
Change-Id: I2d3ec8a997d902c9d00a577a56f4b152b10e078a
diff --git a/java/lint.go b/java/lint.go
index 9827159..7a6e5d9 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -190,10 +190,8 @@
 
 	extraCheckModules := l.properties.Lint.Extra_check_modules
 
-	if checkOnly := ctx.Config().Getenv("ANDROID_LINT_CHECK"); checkOnly != "" {
-		if checkOnlyModules := ctx.Config().Getenv("ANDROID_LINT_CHECK_EXTRA_MODULES"); checkOnlyModules != "" {
-			extraCheckModules = strings.Split(checkOnlyModules, ",")
-		}
+	if extraCheckModulesEnv := ctx.Config().Getenv("ANDROID_LINT_CHECK_EXTRA_MODULES"); extraCheckModulesEnv != "" {
+		extraCheckModules = append(extraCheckModules, strings.Split(extraCheckModulesEnv, ",")...)
 	}
 
 	ctx.AddFarVariationDependencies(ctx.Config().BuildOSCommonTarget.Variations(),