Merge "Pass platform version name as --version-name for framework-res.apk"

This commit is contained in:
Treehugger Robot
2018-05-10 00:54:12 +00:00
committed by Gerrit Code Review
3 changed files with 7 additions and 2 deletions

View File

@@ -468,6 +468,10 @@ func (c *config) ResourceOverlays() []string {
return *c.productVariables.ResourceOverlays
}
func (c *config) PlatformVersionName() string {
return String(c.productVariables.Platform_version_name)
}
func (c *config) PlatformSdkVersionInt() int {
return *c.productVariables.Platform_sdk_version
}

View File

@@ -109,6 +109,7 @@ type productVariables struct {
BuildNumberFromFile *string `json:",omitempty"`
DateFromFile *string `json:",omitempty"`
Platform_version_name *string `json:",omitempty"`
Platform_sdk_version *int `json:",omitempty"`
Platform_sdk_codename *string `json:",omitempty"`
Platform_sdk_final *bool `json:",omitempty"`

View File

@@ -150,8 +150,8 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkVersion string) (flags [
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()
// if it contains the build number. Use the PlatformVersionName instead.
versionName = ctx.Config().PlatformVersionName()
} else {
versionName = ctx.Config().AppsDefaultVersionName()
}