diff --git a/apex/androidmk.go b/apex/androidmk.go index 20912743f..a7a010754 100644 --- a/apex/androidmk.go +++ b/apex/androidmk.go @@ -103,6 +103,11 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, apexName, mo return moduleNames } + // Avoid creating duplicate build rules for multi-installed APEXes. + if proptools.BoolDefault(a.properties.Multi_install_skip_symbol_files, false) { + return moduleNames + } + var postInstallCommands []string for _, fi := range a.filesInfo { if a.linkToSystemLib && fi.transitiveDep && fi.availableToPlatform() { diff --git a/apex/apex.go b/apex/apex.go index 20660d345..378efe65d 100644 --- a/apex/apex.go +++ b/apex/apex.go @@ -145,6 +145,16 @@ type apexBundleProperties struct { // Should be only used in non-system apexes (e.g. vendor: true). Default is false. Use_vndk_as_stable *bool + // Whether this is multi-installed APEX should skip installing symbol files. + // Multi-installed APEXes share the same apex_name and are installed at the same time. + // Default is false. + // + // Should be set to true for all multi-installed APEXes except the singular + // default version within the multi-installed group. + // Only the default version can install symbol files in $(PRODUCT_OUT}/apex, + // or else conflicting build rules may be created. + Multi_install_skip_symbol_files *bool + // List of SDKs that are used to build this APEX. A reference to an SDK should be either // `name#version` or `name` which is an alias for `name#current`. If left empty, // `platform#current` is implied. This value affects all modules included in this APEX. In