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

Commit b0aabb1f authored by Spandan Das's avatar Spandan Das
Browse files

AddLoadHookWithPriority function in build/soong/android

This is a wrapper around `AddLoadHookWithPriority` in build/blueprint,
and allows users to add a load hook at a specified priority.

One use case for this is to defer autogenerated rro creation load hook
of override_android_app

Test: m nothing --no-skip-soong-tests
Change-Id: Ib0f6cbcb87099700df4dfcc1d6af740f96c419e9
parent 44c5548d
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -59,6 +59,16 @@ func AddLoadHook(m blueprint.Module, hook func(LoadHookContext)) {
	})
}

func AddLoadHookWithPriority(m blueprint.Module, hook func(LoadHookContext), priority int) {
	blueprint.AddLoadHookWithPriority(m, func(ctx blueprint.LoadHookContext) {
		actx := &loadHookContext{
			earlyModuleContext: m.(Module).base().earlyModuleContextFactory(ctx),
			bp:                 ctx,
		}
		hook(actx)
	}, priority)
}

type loadHookContext struct {
	earlyModuleContext
	bp     blueprint.LoadHookContext