diff options
Diffstat (limited to 'android')
-rw-r--r-- | android/androidmk.go | 3 | ||||
-rw-r--r-- | android/module.go | 12 | ||||
-rw-r--r-- | android/module_proxy.go | 4 | ||||
-rw-r--r-- | android/otatools_package_cert_zip.go | 2 | ||||
-rw-r--r-- | android/packaging.go | 41 | ||||
-rw-r--r-- | android/variable.go | 4 |
6 files changed, 50 insertions, 16 deletions
diff --git a/android/androidmk.go b/android/androidmk.go index 784559312..7cc6aef00 100644 --- a/android/androidmk.go +++ b/android/androidmk.go @@ -510,6 +510,9 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod Module) { a.EntryMap = make(map[string][]string) base := mod.base() name := base.BaseModuleName() + if bmn, ok := mod.(baseModuleName); ok { + name = bmn.BaseModuleName() + } if a.OverrideName != "" { name = a.OverrideName } diff --git a/android/module.go b/android/module.go index ecd0f239c..c0abfd0a3 100644 --- a/android/module.go +++ b/android/module.go @@ -45,6 +45,14 @@ type Module interface { // For more information, see Module.GenerateBuildActions within Blueprint's module_ctx.go GenerateAndroidBuildActions(ModuleContext) + // CleanupAfterBuildActions is called after ModuleBase.GenerateBuildActions is finished. + // If all interactions with this module are handled via providers instead of direct access + // to the module then it can free memory attached to the module. + // This is a temporary measure to reduce memory usage, eventually blueprint's reference + // to the Module should be dropped after GenerateAndroidBuildActions once all accesses + // can be done through providers. + CleanupAfterBuildActions() + // Add dependencies to the components of a module, i.e. modules that are created // by the module and which are considered to be part of the creating module. // @@ -2387,8 +2395,12 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext) }) } } + + m.module.CleanupAfterBuildActions() } +func (m *ModuleBase) CleanupAfterBuildActions() {} + func SetJarJarPrefixHandler(handler func(ModuleContext)) { if jarJarPrefixHandler != nil { panic("jarJarPrefixHandler already set") diff --git a/android/module_proxy.go b/android/module_proxy.go index 561c4770c..81d90e9a0 100644 --- a/android/module_proxy.go +++ b/android/module_proxy.go @@ -27,6 +27,10 @@ func (m ModuleProxy) GenerateAndroidBuildActions(context ModuleContext) { panic("method is not implemented on ModuleProxy") } +func (m ModuleProxy) CleanupAfterBuildActions() { + panic("method is not implemented on ModuleProxy") +} + func (m ModuleProxy) ComponentDepsMutator(ctx BottomUpMutatorContext) { panic("method is not implemented on ModuleProxy") } diff --git a/android/otatools_package_cert_zip.go b/android/otatools_package_cert_zip.go index 03265cad3..3a654cfe5 100644 --- a/android/otatools_package_cert_zip.go +++ b/android/otatools_package_cert_zip.go @@ -39,7 +39,7 @@ func OtatoolsPackageFactory() Module { var ( otatoolsPackageCertRule = pctx.AndroidStaticRule("otatools_package_cert_files", blueprint.RuleParams{ - Command: "echo $out: > ${out}.d && cat $in >> ${out}.d && ${SoongZipCmd} -o $out -l $in", + Command: "echo '$out : ' $$(cat $in) > ${out}.d && ${SoongZipCmd} -o $out -l $in", CommandDeps: []string{"${SoongZipCmd}"}, Depfile: "${out}.d", Description: "Zip otatools-package cert files", diff --git a/android/packaging.go b/android/packaging.go index bb1fe4e45..bf1840929 100644 --- a/android/packaging.go +++ b/android/packaging.go @@ -506,13 +506,11 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleCont // all packaging specs gathered from the high priority deps. var highPriorities []PackagingSpec - // Name of the dependency which requested the packaging spec. - // If this dep is overridden, the packaging spec will not be installed via this dependency chain. - // (the packaging spec might still be installed if there are some other deps which depend on it). - var depNames []string - // list of module names overridden - var overridden []string + overridden := make(map[string]bool) + + // all installed modules which are not overridden. + modulesToInstall := make(map[string]bool) var arches []ArchType for _, target := range getSupportedTargets(ctx) { @@ -529,6 +527,7 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleCont return false } + // find all overridden modules and packaging specs ctx.VisitDirectDepsProxy(func(child ModuleProxy) { depTag := ctx.OtherModuleDependencyTag(child) if pi, ok := depTag.(PackagingItem); !ok || !pi.IsPackagingItem() { @@ -556,20 +555,32 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleCont regularPriorities = append(regularPriorities, ps) } - depNames = append(depNames, child.Name()) - overridden = append(overridden, ps.overrides.ToSlice()...) + for o := range ps.overrides.Iter() { + overridden[o] = true + } + } + }) + + // gather modules to install, skipping overridden modules + ctx.WalkDeps(func(child, parent Module) bool { + owner := ctx.OtherModuleName(child) + if o, ok := child.(OverridableModule); ok { + if overriddenBy := o.GetOverriddenBy(); overriddenBy != "" { + owner = overriddenBy + } + } + if overridden[owner] { + return false } + modulesToInstall[owner] = true + return true }) filterOverridden := func(input []PackagingSpec) []PackagingSpec { - // input minus packaging specs that are overridden + // input minus packaging specs that are not installed var filtered []PackagingSpec - for index, ps := range input { - if ps.owner != "" && InList(ps.owner, overridden) { - continue - } - // The dependency which requested this packaging spec has been overridden. - if InList(depNames[index], overridden) { + for _, ps := range input { + if !modulesToInstall[ps.owner] { continue } filtered = append(filtered, ps) diff --git a/android/variable.go b/android/variable.go index 357d137c7..f00dd138b 100644 --- a/android/variable.go +++ b/android/variable.go @@ -715,6 +715,10 @@ type PartitionVariables struct { ReleaseToolsExtensionDir string `json:",omitempty"` + BoardPartialOtaUpdatePartitionsList []string `json:",omitempty"` + BoardFlashBlockSize string `json:",omitempty"` + BootloaderInUpdatePackage bool `json:",omitempty"` + BoardFastbootInfoFile string `json:",omitempty"` } |