Merge "Allow for overriding container packagename for an Apex." am: c822818147 am: 5b88818470

Change-Id: Ic41a6ec13f3d8dbceda05fb3c330ac5cee01aca5
This commit is contained in:
Automerger Merge Worker 2020-03-16 23:42:50 +00:00
commit 78c5fa002b
3 changed files with 9 additions and 1 deletions

View File

@ -1358,6 +1358,10 @@ type overridableProperties struct {
// Logging Parent value
Logging_parent string
// Apex Container Package Name.
// Override value for attribute package:name in AndroidManifest.xml
Package_name string
}
type apexPackaging int

View File

@ -3664,6 +3664,7 @@ func TestOverrideApex(t *testing.T) {
apps: ["override_app"],
overrides: ["unknownapex"],
logging_parent: "com.foo.bar",
package_name: "test.overridden.package",
}
apex_key {
@ -3715,7 +3716,7 @@ func TestOverrideApex(t *testing.T) {
}
optFlags := apexRule.Args["opt_flags"]
ensureContains(t, optFlags, "--override_apk_package_name com.android.myapex")
ensureContains(t, optFlags, "--override_apk_package_name test.overridden.package")
data := android.AndroidMkDataForTest(t, config, "", apexBundle)
var builder strings.Builder

View File

@ -658,6 +658,9 @@ func (a *apexBundle) getOverrideManifestPackageName(ctx android.ModuleContext) s
}
return ""
}
if a.overridableProperties.Package_name != "" {
return a.overridableProperties.Package_name
}
manifestPackageName, overridden := ctx.DeviceConfig().OverrideManifestPackageNameFor(ctx.ModuleName())
if overridden {
return manifestPackageName