Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex BUG: 148198056 Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
This commit is contained in:
parent
8fed7d4057
commit
5b57dbad86
3 changed files with 9 additions and 1 deletions
|
@ -1359,6 +1359,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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -657,6 +657,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
|
||||
|
|
Loading…
Reference in a new issue