Pass platform version name as --version-name for framework-res.apk
framework-res.apk should get the platform version name ("9") as --version-name, not the SDK version ("28"). It will get copied to compileSdkVersionCodename in APKs compiled against it. Bug: 78324052 Test: aapt dump badging $OUT/system/framework/framework-res.apk | grep -i version Change-Id: I34a601cb2c14f66199066e7d598862108da0b950
This commit is contained in:
@@ -468,6 +468,10 @@ func (c *config) ResourceOverlays() []string {
|
|||||||
return *c.productVariables.ResourceOverlays
|
return *c.productVariables.ResourceOverlays
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *config) PlatformVersionName() string {
|
||||||
|
return String(c.productVariables.Platform_version_name)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *config) PlatformSdkVersionInt() int {
|
func (c *config) PlatformSdkVersionInt() int {
|
||||||
return *c.productVariables.Platform_sdk_version
|
return *c.productVariables.Platform_sdk_version
|
||||||
}
|
}
|
||||||
|
@@ -127,6 +127,7 @@ type productVariables struct {
|
|||||||
BuildNumberFromFile *string `json:",omitempty"`
|
BuildNumberFromFile *string `json:",omitempty"`
|
||||||
DateFromFile *string `json:",omitempty"`
|
DateFromFile *string `json:",omitempty"`
|
||||||
|
|
||||||
|
Platform_version_name *string `json:",omitempty"`
|
||||||
Platform_sdk_version *int `json:",omitempty"`
|
Platform_sdk_version *int `json:",omitempty"`
|
||||||
Platform_sdk_codename *string `json:",omitempty"`
|
Platform_sdk_codename *string `json:",omitempty"`
|
||||||
Platform_sdk_final *bool `json:",omitempty"`
|
Platform_sdk_final *bool `json:",omitempty"`
|
||||||
|
@@ -150,8 +150,8 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkVersion string) (flags [
|
|||||||
if ctx.ModuleName() == "framework-res" {
|
if ctx.ModuleName() == "framework-res" {
|
||||||
// Some builds set AppsDefaultVersionName() to include the build number ("O-123456"). aapt2 copies the
|
// 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
|
// version name of framework-res into app manifests as compileSdkVersionCodename, which confuses things
|
||||||
// if it contains the build number. Use the DefaultAppTargetSdk instead.
|
// if it contains the build number. Use the PlatformVersionName instead.
|
||||||
versionName = ctx.Config().DefaultAppTargetSdk()
|
versionName = ctx.Config().PlatformVersionName()
|
||||||
} else {
|
} else {
|
||||||
versionName = ctx.Config().AppsDefaultVersionName()
|
versionName = ctx.Config().AppsDefaultVersionName()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user