diff options
Diffstat (limited to 'android/config.go')
| -rw-r--r-- | android/config.go | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/android/config.go b/android/config.go index 10c30d4df..2ee3b9355 100644 --- a/android/config.go +++ b/android/config.go @@ -114,6 +114,8 @@ const ( GenerateDocFile ) +const testKeyDir = "build/make/target/product/security" + // SoongOutDir returns the build output directory for the configuration. func (c Config) SoongOutDir() string { return c.soongOutDir @@ -841,6 +843,10 @@ func (c *config) BuildId() string { return String(c.productVariables.BuildId) } +func (c *config) DisplayBuildNumber() bool { + return Bool(c.productVariables.DisplayBuildNumber) +} + // BuildNumberFile returns the path to a text file containing metadata // representing the current build's number. // @@ -852,6 +858,23 @@ func (c *config) BuildNumberFile(ctx PathContext) Path { return PathForOutput(ctx, String(c.productVariables.BuildNumberFile)) } +// BuildHostnameFile returns the path to a text file containing metadata +// representing the current build's host name. +func (c *config) BuildHostnameFile(ctx PathContext) Path { + return PathForOutput(ctx, String(c.productVariables.BuildHostnameFile)) +} + +// BuildThumbprintFile returns the path to a text file containing metadata +// representing the current build's thumbprint. +// +// Rules that want to reference the build thumbprint should read from this file +// without depending on it. They will run whenever their other dependencies +// require them to run and get the current build thumbprint. This ensures they +// don't rebuild on every incremental build when the build thumbprint changes. +func (c *config) BuildThumbprintFile(ctx PathContext) Path { + return PathForArbitraryOutput(ctx, "target", "product", c.DeviceName(), String(c.productVariables.BuildThumbprintFile)) +} + // DeviceName returns the name of the current device target. // TODO: take an AndroidModuleContext to select the device name for multi-device builds func (c *config) DeviceName() string { @@ -873,6 +896,10 @@ func (c *config) HasDeviceProduct() bool { return c.productVariables.DeviceProduct != nil } +func (c *config) DeviceAbi() []string { + return c.productVariables.DeviceAbi +} + func (c *config) DeviceResourceOverlays() []string { return c.productVariables.DeviceResourceOverlays } @@ -881,6 +908,10 @@ func (c *config) ProductResourceOverlays() []string { return c.productVariables.ProductResourceOverlays } +func (c *config) PlatformDisplayVersionName() string { + return String(c.productVariables.Platform_display_version_name) +} + func (c *config) PlatformVersionName() string { return String(c.productVariables.Platform_version_name) } @@ -1038,7 +1069,7 @@ func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath { if defaultCert != "" { return PathForSource(ctx, filepath.Dir(defaultCert)) } - return PathForSource(ctx, "build/make/target/product/security") + return PathForSource(ctx, testKeyDir) } func (c *config) DefaultAppCertificate(ctx PathContext) (pem, key SourcePath) { @@ -1050,10 +1081,18 @@ func (c *config) DefaultAppCertificate(ctx PathContext) (pem, key SourcePath) { return defaultDir.Join(ctx, "testkey.x509.pem"), defaultDir.Join(ctx, "testkey.pk8") } +func (c *config) BuildKeys() string { + defaultCert := String(c.productVariables.DefaultAppCertificate) + if defaultCert == "" || defaultCert == filepath.Join(testKeyDir, "testkey") { + return "test-keys" + } + return "dev-keys" +} + func (c *config) ApexKeyDir(ctx ModuleContext) SourcePath { // TODO(b/121224311): define another variable such as TARGET_APEX_KEY_OVERRIDE defaultCert := String(c.productVariables.DefaultAppCertificate) - if defaultCert == "" || filepath.Dir(defaultCert) == "build/make/target/product/security" { + if defaultCert == "" || filepath.Dir(defaultCert) == testKeyDir { // When defaultCert is unset or is set to the testkeys path, use the APEX keys // that is under the module dir return pathForModuleSrc(ctx) @@ -1112,6 +1151,10 @@ func (c *config) Eng() bool { return Bool(c.productVariables.Eng) } +func (c *config) BuildType() string { + return String(c.productVariables.BuildType) +} + // DevicePrimaryArchType returns the ArchType for the first configured device architecture, or // Common if there are no device architectures. func (c *config) DevicePrimaryArchType() ArchType { @@ -2086,3 +2129,19 @@ func (c *config) AllApexContributions() []string { func (c *config) BuildIgnoreApexContributionContents() []string { return c.productVariables.BuildIgnoreApexContributionContents } + +func (c *config) ProductLocales() []string { + return c.productVariables.ProductLocales +} + +func (c *config) ProductDefaultWifiChannels() []string { + return c.productVariables.ProductDefaultWifiChannels +} + +func (c *config) BoardUseVbmetaDigestInFingerprint() bool { + return Bool(c.productVariables.BoardUseVbmetaDigestInFingerprint) +} + +func (c *config) OemProperties() []string { + return c.productVariables.OemProperties +} |