From 61ae0b7eedf030cb482aa3e3c2a0ae6db1aed840 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Fri, 1 Dec 2017 17:16:02 -0800 Subject: [PATCH] Use default app certificate from Make Bug: 69917341 Test: m checkbuild Test: framework-res.apk is identical after converting to Soong Change-Id: I6980afd94ea130740da0defeea045eddc2fc6439 --- android/config.go | 14 ++++++++++++-- android/variable.go | 2 ++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/android/config.go b/android/config.go index 2589f71c2..8ae6471b8 100644 --- a/android/config.go +++ b/android/config.go @@ -491,11 +491,21 @@ func (c *config) ProductAAPTPrebuiltDPI() []string { } func (c *config) DefaultAppCertificateDir(ctx PathContext) SourcePath { - return PathForSource(ctx, "build/target/product/security") + defaultCert := String(c.ProductVariables.DefaultAppCertificate) + if defaultCert != "" { + return PathForSource(ctx, filepath.Dir(defaultCert)) + } else { + return PathForSource(ctx, "build/target/product/security") + } } func (c *config) DefaultAppCertificate(ctx PathContext) SourcePath { - return c.DefaultAppCertificateDir(ctx).Join(ctx, "testkey") + defaultCert := String(c.ProductVariables.DefaultAppCertificate) + if defaultCert != "" { + return PathForSource(ctx, defaultCert) + } else { + return c.DefaultAppCertificateDir(ctx).Join(ctx, "testkey") + } } func (c *config) AllowMissingDependencies() bool { diff --git a/android/variable.go b/android/variable.go index c8a672e31..e8d5c69bb 100644 --- a/android/variable.go +++ b/android/variable.go @@ -141,6 +141,8 @@ type productVariables struct { AAPTPreferredConfig *string `json:",omitempty"` AAPTPrebuiltDPI *[]string `json:",omitempty"` + DefaultAppCertificate *string `json:",omitempty"` + AppsDefaultVersionName *string `json:",omitempty"` Allow_missing_dependencies *bool `json:",omitempty"`