Remove apex10000_private variants

When a library is included in two APEXes whose platform_apis settings
are different, two apex variants of the library is created: apex1000 and
apex1000_private.

This change was introduced with ag/15061306, especially by the commit
[1].

However, that part should be reverted because it actually creates
unnecessary variants. It's unnecessary because the two variants of the
library are compiled (excluding the linking) exactly the same. If a
private symbol of its dependency was actually used when compiling the
apex1000_private variant, then the other apex1000 variant wouldn't have
been built because that private symbol must have caused a linkage error.

[1] https://googleplex-android-review.git.corp.google.com/c/platform/build/soong/+/15061306/2..4/android/apex.go#b527).

Bug: 228785792
Test: m
Change-Id: Id58d3e98a51de5e628ca72ef86e9cd11b0ee8971
This commit is contained in:
Jiyong Park
2022-04-12 12:23:20 +09:00
parent 26ef058655
commit d4a0063d3e
3 changed files with 22 additions and 13 deletions

View File

@@ -113,9 +113,6 @@ func (i ApexInfo) mergedName(ctx PathContext) string {
for _, sdk := range i.RequiredSdks {
name += "_" + sdk.Name + "_" + sdk.Version
}
if i.UsePlatformApis {
name += "_private"
}
return name
}
@@ -546,10 +543,9 @@ func mergeApexVariations(ctx PathContext, apexInfos []ApexInfo) (merged []ApexIn
merged[index].InApexModules = append(merged[index].InApexModules, apexInfo.InApexModules...)
merged[index].ApexContents = append(merged[index].ApexContents, apexInfo.ApexContents...)
merged[index].Updatable = merged[index].Updatable || apexInfo.Updatable
if merged[index].UsePlatformApis != apexInfo.UsePlatformApis {
panic(fmt.Errorf("variants having different UsePlatformApis can't be merged"))
}
merged[index].UsePlatformApis = apexInfo.UsePlatformApis
// Platform APIs is allowed for this module only when all APEXes containing
// the module are with `use_platform_apis: true`.
merged[index].UsePlatformApis = merged[index].UsePlatformApis && apexInfo.UsePlatformApis
} else {
seen[mergedName] = len(merged)
apexInfo.ApexVariationName = mergedName