Merge "Use BaseApexName to generate permission file for sdk library" into main am: c0cbb491d5

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3137737

Change-Id: Ia1fb053a18dfe27100c0c5a8d7ab084822ff0603
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2024-06-19 04:50:37 +00:00
committed by Automerger Merge Worker
3 changed files with 5 additions and 1 deletions

View File

@@ -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.

View File

@@ -1043,6 +1043,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) {

View File

@@ -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() {