diff options
-rw-r--r-- | java/app.go | 4 | ||||
-rw-r--r-- | java/app_import.go | 8 | ||||
-rw-r--r-- | java/rro.go | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/java/app.go b/java/app.go index 8bb73cb38..7f80160a3 100644 --- a/java/app.go +++ b/java/app.go @@ -164,7 +164,7 @@ type appProperties struct { type overridableAppProperties struct { // The name of a certificate in the default certificate directory, blank to use the default product certificate, // or an android_app_certificate module name in the form ":module". - Certificate *string + Certificate proptools.Configurable[string] `android:"replace_instead_of_append"` // Name of the signing certificate lineage file or filegroup module. Lineage *string `android:"path"` @@ -1252,7 +1252,7 @@ func (a *AndroidApp) getCertString(ctx android.BaseModuleContext) string { if overridden { return ":" + certificate } - return String(a.overridableAppProperties.Certificate) + return a.overridableAppProperties.Certificate.GetOrDefault(ctx, "") } func (a *AndroidApp) DepIsInSameApex(ctx android.BaseModuleContext, dep android.Module) bool { diff --git a/java/app_import.go b/java/app_import.go index f044c6848..8951c7d9c 100644 --- a/java/app_import.go +++ b/java/app_import.go @@ -97,7 +97,7 @@ type AndroidAppImportProperties struct { // The name of a certificate in the default certificate directory or an android_app_certificate // module name in the form ":module". Should be empty if presigned or default_dev_cert is set. - Certificate *string + Certificate proptools.Configurable[string] `android:"replace_instead_of_append"` // Names of extra android_app_certificate modules to sign the apk with in the form ":module". Additional_certificates []string @@ -240,7 +240,7 @@ func disablePrebuiltsWithoutApkMutator(ctx android.BottomUpMutatorContext) { } func (a *AndroidAppImport) DepsMutator(ctx android.BottomUpMutatorContext) { - cert := android.SrcIsModule(String(a.properties.Certificate)) + cert := android.SrcIsModule(a.properties.Certificate.GetOrDefault(ctx, "")) if cert != "" { ctx.AddDependency(ctx.Module(), certificateTag, cert) } @@ -323,7 +323,7 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext } numCertPropsSet := 0 - if String(a.properties.Certificate) != "" { + if a.properties.Certificate.GetOrDefault(ctx, "") != "" { numCertPropsSet++ } if Bool(a.properties.Presigned) { @@ -406,7 +406,7 @@ func (a *AndroidAppImport) generateAndroidBuildActions(ctx android.ModuleContext // If the certificate property is empty at this point, default_dev_cert must be set to true. // Which makes processMainCert's behavior for the empty cert string WAI. _, _, certificates := collectAppDeps(ctx, a, false, false) - a.certificate, certificates = processMainCert(a.ModuleBase, String(a.properties.Certificate), certificates, ctx) + a.certificate, certificates = processMainCert(a.ModuleBase, a.properties.Certificate.GetOrDefault(ctx, ""), certificates, ctx) signed := android.PathForModuleOut(ctx, "signed", apkFilename) var lineageFile android.Path if lineage := String(a.properties.Lineage); lineage != "" { diff --git a/java/rro.go b/java/rro.go index 8bb9be2eb..f225e1f4e 100644 --- a/java/rro.go +++ b/java/rro.go @@ -50,7 +50,7 @@ type RuntimeResourceOverlay struct { type RuntimeResourceOverlayProperties struct { // the name of a certificate in the default certificate directory or an android_app_certificate // module name in the form ":module". - Certificate *string + Certificate proptools.Configurable[string] `android:"replace_instead_of_append"` // Name of the signing certificate lineage file. Lineage *string @@ -119,7 +119,7 @@ func (r *RuntimeResourceOverlay) DepsMutator(ctx android.BottomUpMutatorContext) r.aapt.deps(ctx, sdkDep) } - cert := android.SrcIsModule(String(r.properties.Certificate)) + cert := android.SrcIsModule(r.properties.Certificate.GetOrDefault(ctx, "")) if cert != "" { ctx.AddDependency(ctx.Module(), certificateTag, cert) } @@ -166,7 +166,7 @@ func (r *RuntimeResourceOverlay) GenerateAndroidBuildActions(ctx android.ModuleC // Sign the built package _, _, certificates := collectAppDeps(ctx, r, false, false) - r.certificate, certificates = processMainCert(r.ModuleBase, String(r.properties.Certificate), certificates, ctx) + r.certificate, certificates = processMainCert(r.ModuleBase, r.properties.Certificate.GetOrDefault(ctx, ""), certificates, ctx) signed := android.PathForModuleOut(ctx, "signed", r.Name()+".apk") var lineageFile android.Path if lineage := String(r.properties.Lineage); lineage != "" { |