Add option to override defaultManifestVersion for app.

Add an option to override defaultManifestVersion using environment
variable. With this environment variable, the mainline developer will be able to locally customize the app version to higher version and install it to target devices. This is also helpful as a workaround to adjust app/apex version for coverage build (e.g. 3520 to 3500) and allow the installation of app/apex from mainline release branch (e.g. 3508) onto it. This functionality already existed for apex, so we are extending to the app.

Test: 347735412
Bug: 350986287
Bug: 347735412
Test: OVERRIDE_APEX_MANIFEST_DEFAULT_VERSION=990090000 m
Test: adb shell pm list packages --show-versioncode
Change-Id: I58259fe781ca121ba4067f308f1744d80c1c2d48
diff --git a/java/app.go b/java/app.go
index d2f2d0b..93cd138 100644
--- a/java/app.go
+++ b/java/app.go
@@ -539,7 +539,11 @@
 	a.aapt.splitNames = a.appProperties.Package_splits
 	a.aapt.LoggingParent = String(a.overridableAppProperties.Logging_parent)
 	if a.Updatable() {
-		a.aapt.defaultManifestVersion = android.DefaultUpdatableModuleVersion
+		if override := ctx.Config().Getenv("OVERRIDE_APEX_MANIFEST_DEFAULT_VERSION"); override != "" {
+			a.aapt.defaultManifestVersion = override
+		} else {
+			a.aapt.defaultManifestVersion = android.DefaultUpdatableModuleVersion
+		}
 	}
 
 	// Use non final ids if we are doing optimized shrinking and are using R8.