VNDK APEX doesn't use "apex_name" property

VNDK APEX has been using "apex_name" property to set "name" field in
apex_manifest. But setting apex_name had a side-effect of emitting
duplicate rules for symbol files for VNDK APEX and its override_apex.
(Please see the removed comments for more details about error)

Not using "apex_name" fixes the duplicate errors.

There're a few more vendor apexes with the same issue, which I will
handle in follow-ups.

Bug: 267581665
Test: m (soong test) && boot
Change-Id: I00f617cef8af4d21880d4e8b9c0b9ab9322ba15c
This commit is contained in:
Jooyung Han
2023-02-06 18:29:08 +09:00
parent 1bb18bb2ac
commit 2cd2f9ad89
4 changed files with 9 additions and 34 deletions

View File

@@ -241,10 +241,11 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
provideNativeLibs = android.SortedUniqueStrings(provideNativeLibs)
requireNativeLibs = android.SortedUniqueStrings(android.RemoveListFromList(requireNativeLibs, provideNativeLibs))
// APEX name can be overridden
// VNDK APEX name is determined at runtime, so update "name" in apex_manifest
optCommands := []string{}
if a.properties.Apex_name != nil {
optCommands = append(optCommands, "-v name "+*a.properties.Apex_name)
if a.vndkApex {
apexName := vndkApexNamePrefix + a.vndkVersion(ctx.DeviceConfig())
optCommands = append(optCommands, "-v name "+apexName)
}
// Collect jniLibs. Notice that a.filesInfo is already sorted
@@ -454,14 +455,6 @@ func (a *apexBundle) buildUnflattenedApex(ctx android.ModuleContext) {
installSymbolFiles := (!ctx.Config().KatiEnabled() || a.ExportedToMake()) && a.installable()
// b/140136207. When there are overriding APEXes for a VNDK APEX, the symbols file for the overridden
// APEX and the overriding APEX will have the same installation paths at /apex/com.android.vndk.v<ver>
// as their apexName will be the same. To avoid the path conflicts, skip installing the symbol files
// for the overriding VNDK APEXes.
if a.vndkApex && len(a.overridableProperties.Overrides) > 0 {
installSymbolFiles = false
}
// Avoid creating duplicate build rules for multi-installed APEXes.
if proptools.BoolDefault(a.properties.Multi_install_skip_symbol_files, false) {
installSymbolFiles = false
@@ -1012,7 +1005,7 @@ func (a *apexBundle) getOverrideManifestPackageName(ctx android.ModuleContext) s
if a.vndkApex {
overrideName, overridden := ctx.DeviceConfig().OverrideManifestPackageNameFor(vndkApexName)
if overridden {
return strings.Replace(*a.properties.Apex_name, vndkApexName, overrideName, 1)
return overrideName + ".v" + a.vndkVersion(ctx.DeviceConfig())
}
return ""
}