Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c324019f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add generated prebuilt_* modules to high_priority_deps by default" into main

parents 51778812 0d7b0117
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -592,8 +592,10 @@ func generateBpContent(ctx android.EarlyModuleContext, partitionType string) str
	}

	baseProps := generateBaseProps(proptools.StringPtr(generatedModuleNameForPartition(ctx.Config(), partitionType)))
	deps := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState).fsDeps[partitionType]
	depProps := generateDepStruct(*deps)
	fsGenState := ctx.Config().Get(fsGenStateOnceKey).(*FsGenState)
	deps := fsGenState.fsDeps[partitionType]
	highPriorityDeps := fsGenState.generatedPrebuiltEtcModuleNames
	depProps := generateDepStruct(*deps, highPriorityDeps)

	result, err := proptools.RepackProperties([]interface{}{baseProps, fsProps, depProps})
	if err != nil {
+8 −5
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ type FsGenState struct {
	fsDepsMutex sync.Mutex
	// Map of _all_ soong module names to their corresponding installation properties
	moduleToInstallationProps map[string]installationProperties
	// List of prebuilt_* modules that are autogenerated.
	generatedPrebuiltEtcModuleNames []string
}

type installationProperties struct {
@@ -176,6 +178,7 @@ func createFsGenState(ctx android.LoadHookContext, generatedPrebuiltEtcModuleNam
			},
			fsDepsMutex:                     sync.Mutex{},
			moduleToInstallationProps:       map[string]installationProperties{},
			generatedPrebuiltEtcModuleNames: generatedPrebuiltEtcModuleNames,
		}

		if avbpubkeyGenerated {
@@ -284,7 +287,7 @@ func setDepsMutator(mctx android.BottomUpMutatorContext) {
	soongGeneratedPartitionMap := getAllSoongGeneratedPartitionNames(mctx.Config(), fsGenState.soongGeneratedPartitions)
	m := mctx.Module()
	if partition, ok := soongGeneratedPartitionMap[m.Name()]; ok {
		depsStruct := generateDepStruct(*fsDeps[partition])
		depsStruct := generateDepStruct(*fsDeps[partition], fsGenState.generatedPrebuiltEtcModuleNames)
		if err := proptools.AppendMatchingProperties(m.GetProperties(), depsStruct, nil); err != nil {
			mctx.ModuleErrorf(err.Error())
		}
@@ -343,12 +346,12 @@ func isHighPriorityDep(depName string) bool {
	return false
}

func generateDepStruct(deps map[string]*depCandidateProps) *packagingPropsStruct {
func generateDepStruct(deps map[string]*depCandidateProps, highPriorityDeps []string) *packagingPropsStruct {
	depsStruct := packagingPropsStruct{}
	for depName, depProps := range deps {
		bitness := getBitness(depProps.Arch)
		fullyQualifiedDepName := fullyQualifiedModuleName(depName, depProps.Namespace)
		if isHighPriorityDep(depName) {
		if android.InList(depName, highPriorityDeps) {
			depsStruct.High_priority_deps = append(depsStruct.High_priority_deps, fullyQualifiedDepName)
		} else if android.InList("32", bitness) && android.InList("64", bitness) {
			// If both 32 and 64 bit variants are enabled for this module