diff --git a/android/config.go b/android/config.go
index 18f89fb..10c30d4 100644
--- a/android/config.go
+++ b/android/config.go
@@ -114,8 +114,6 @@
 	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
@@ -843,10 +841,6 @@
 	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.
 //
@@ -858,23 +852,6 @@
 	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 PathForOutput(ctx, 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 {
@@ -896,10 +873,6 @@
 	return c.productVariables.DeviceProduct != nil
 }
 
-func (c *config) DeviceAbi() []string {
-	return c.productVariables.DeviceAbi
-}
-
 func (c *config) DeviceResourceOverlays() []string {
 	return c.productVariables.DeviceResourceOverlays
 }
@@ -908,10 +881,6 @@
 	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)
 }
@@ -1069,7 +1038,7 @@
 	if defaultCert != "" {
 		return PathForSource(ctx, filepath.Dir(defaultCert))
 	}
-	return PathForSource(ctx, testKeyDir)
+	return PathForSource(ctx, "build/make/target/product/security")
 }
 
 func (c *config) DefaultAppCertificate(ctx PathContext) (pem, key SourcePath) {
@@ -1081,18 +1050,10 @@
 	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) == testKeyDir {
+	if defaultCert == "" || filepath.Dir(defaultCert) == "build/make/target/product/security" {
 		// When defaultCert is unset or is set to the testkeys path, use the APEX keys
 		// that is under the module dir
 		return pathForModuleSrc(ctx)
@@ -1151,10 +1112,6 @@
 	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 {
@@ -2129,19 +2086,3 @@
 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
-}
