From 3707384f02b2de54ca3e894a205d5d9174180292 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Tue, 21 Jun 2022 10:13:42 +0900 Subject: [PATCH] buildinfo_prop generates ro.build.version.known_codenames The sysprop is now generated as the corresponding Make variable PLATFORM_VERSION_KNOWN_CODENAMES is imported. Bug: 236602028 Test: atest ComposHostTestCases Change-Id: Ife7e87ce5de65b57c51d5565e288807cf8360b28 --- android/buildinfo_prop.go | 2 +- android/config.go | 4 ++++ android/variable.go | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/android/buildinfo_prop.go b/android/buildinfo_prop.go index 6339a7181..acebdbbff 100644 --- a/android/buildinfo_prop.go +++ b/android/buildinfo_prop.go @@ -89,6 +89,7 @@ func (p *buildinfoPropModule) GenerateAndroidBuildActions(ctx ModuleContext) { writeProp("ro.build.version.security_patch", config.PlatformSecurityPatch()) writeProp("ro.build.version.base_os", config.PlatformBaseOS()) writeProp("ro.build.version.min_supported_target_sdk", config.PlatformMinSupportedTargetSdkVersion()) + writeProp("ro.build.version.known_codenames", config.PlatformVersionKnownCodenames()) if config.Eng() { writeProp("ro.build.type", "eng") @@ -109,7 +110,6 @@ func (p *buildinfoPropModule) GenerateAndroidBuildActions(ctx ModuleContext) { writeProp("ro.build.display.id", $BUILD_DISPLAY_ID) writeProp("ro.build.version.incremental", $BUILD_NUMBER) writeProp("ro.build.version.preview_sdk_fingerprint", $PLATFORM_PREVIEW_SDK_FINGERPRINT) - writeProp("ro.build.version.known_codenames", $PLATFORM_VERSION_KNOWN_CODENAMES) writeProp("ro.build.version.release_or_preview_display", $PLATFORM_DISPLAY_VERSION) writeProp("ro.build.date", `$DATE`) writeProp("ro.build.date.utc", `$DATE +%s`) diff --git a/android/config.go b/android/config.go index ef712926f..cd902cb86 100644 --- a/android/config.go +++ b/android/config.go @@ -793,6 +793,10 @@ func (c *config) PlatformVersionLastStable() string { return String(c.productVariables.Platform_version_last_stable) } +func (c *config) PlatformVersionKnownCodenames() string { + return String(c.productVariables.Platform_version_known_codenames) +} + func (c *config) MinSupportedSdkVersion() ApiLevel { return uncheckedFinalApiLevel(19) } diff --git a/android/variable.go b/android/variable.go index 9478c0c9e..734ed1b68 100644 --- a/android/variable.go +++ b/android/variable.go @@ -200,6 +200,7 @@ type productVariables struct { Platform_min_supported_target_sdk_version *string `json:",omitempty"` Platform_base_os *string `json:",omitempty"` Platform_version_last_stable *string `json:",omitempty"` + Platform_version_known_codenames *string `json:",omitempty"` DeviceName *string `json:",omitempty"` DeviceProduct *string `json:",omitempty"`