aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-26 07:21:28 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-26 07:21:28 +0000
commit49ebd496eabaf7eefea79ce02d8b7786995044fb (patch)
tree8ea97e091afc9904cac3525269d519a936f28471
parent7653693afd643cea02d50b6bf01e6bc3dd86bd54 (diff)
parente6c053388b5d7f84da09557bf6529b839eda0c77 (diff)
downloadbuild_soong-49ebd496eabaf7eefea79ce02d8b7786995044fb.tar.gz
build_soong-49ebd496eabaf7eefea79ce02d8b7786995044fb.tar.bz2
build_soong-49ebd496eabaf7eefea79ce02d8b7786995044fb.zip
Snap for 4745538 from e6c053388b5d7f84da09557bf6529b839eda0c77 to pi-release
Change-Id: I910ce2b33fac4fffeac04122cf6e9d4434a5365b
-rw-r--r--java/app.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/java/app.go b/java/app.go
index 0db48e76..9360cc56 100644
--- a/java/app.go
+++ b/java/app.go
@@ -310,7 +310,16 @@ func (a *AndroidApp) aapt2Flags(ctx android.ModuleContext) (flags []string, deps
}
if !hasVersionName {
- versionName := proptools.NinjaEscape([]string{ctx.Config().AppsDefaultVersionName()})[0]
+ var versionName string
+ if ctx.ModuleName() == "framework-res" {
+ // Some builds set AppsDefaultVersionName() to include the build number ("O-123456"). aapt2 copies the
+ // version name of framework-res into app manifests as compileSdkVersionCodename, which confuses things
+ // if it contains the build number. Use the DefaultAppTargetSdk instead.
+ versionName = ctx.Config().DefaultAppTargetSdk()
+ } else {
+ versionName = ctx.Config().AppsDefaultVersionName()
+ }
+ versionName = proptools.NinjaEscape([]string{versionName})[0]
linkFlags = append(linkFlags, "--version-name ", versionName)
}