Use BaseApexName to generate permission file for sdk library
Permissions of apex variants of shared java sdk libraries should use the base apex name (com.android.foo) and not the override apex name (com.mycompany.android.foo). The override apex name started being used when separate variants were created for override apex transitive deps (https://r.android.com/3083813) Bug: 346486531 Test: m com.google.android.ipsec Test: verified that out/target/product/<product>/apex/com.google.android.ipsec/etc/permissions/android.net.ipsec.ike.xml contains /apex/com.androiqd.ipsec/javalib/android.net.ipsec.ike.jar # previously it contained com.google.android.ipsec Test: https://android-build.corp.google.com/builds/abtd/run/L59900030004679761 Change-Id: I863170d78efa017bef5e4ece3b1471f74ba84b0c
This commit is contained in:
@@ -84,6 +84,9 @@ type ApexInfo struct {
|
||||
|
||||
// Returns the name of the test apexes that this module is included in.
|
||||
TestApexes []string
|
||||
|
||||
// Returns the name of the overridden apex (com.android.foo)
|
||||
BaseApexName string
|
||||
}
|
||||
|
||||
// AllApexInfo holds the ApexInfo of all apexes that include this module.
|
||||
|
@@ -1040,6 +1040,7 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
|
||||
InApexModules: []string{a.Name()}, // could be com.mycompany.android.foo
|
||||
ApexContents: []*android.ApexContents{apexContents},
|
||||
TestApexes: testApexes,
|
||||
BaseApexName: mctx.ModuleName(),
|
||||
}
|
||||
mctx.WalkDeps(func(child, parent android.Module) bool {
|
||||
if !continueApexDepsWalk(child, parent) {
|
||||
|
@@ -3279,7 +3279,7 @@ func (module *sdkLibraryXml) implPath(ctx android.ModuleContext) string {
|
||||
// TODO(b/146468504): ApexVariationName() is only a soong module name, not apex name.
|
||||
// In most cases, this works fine. But when apex_name is set or override_apex is used
|
||||
// this can be wrong.
|
||||
return fmt.Sprintf("/apex/%s/javalib/%s.jar", apexInfo.ApexVariationName, implName)
|
||||
return fmt.Sprintf("/apex/%s/javalib/%s.jar", apexInfo.BaseApexName, implName)
|
||||
}
|
||||
partition := "system"
|
||||
if module.SocSpecific() {
|
||||
|
Reference in New Issue
Block a user