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
diff --git a/android/hooks.go b/android/hooks.go
index 9f4e5b6..f8022d0 100644
--- a/android/hooks.go
+++ b/android/hooks.go
@@ -59,6 +59,16 @@
})
}
+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