Support reading Providers from TransitionMutator IncomingTransition and OutgoingTransition
Add a provider method to IncomingTransitionContext and OutgoingTransitionContext so they implement ModuleProviderContext and can be passed to android.ModuleProvider. Bug: 319288033 Test: go test ./... Change-Id: Ibf8b0feb78e4062fc044c321a23adcb68373e2f8
This commit is contained in:
@@ -391,6 +391,7 @@ func (x *registerMutatorsContext) BottomUpBlueprint(name string, m blueprint.Bot
|
||||
|
||||
type IncomingTransitionContext interface {
|
||||
ArchModuleContext
|
||||
ModuleProviderContext
|
||||
|
||||
// Module returns the target of the dependency edge for which the transition
|
||||
// is being computed
|
||||
@@ -404,6 +405,7 @@ type IncomingTransitionContext interface {
|
||||
|
||||
type OutgoingTransitionContext interface {
|
||||
ArchModuleContext
|
||||
ModuleProviderContext
|
||||
|
||||
// Module returns the target of the dependency edge for which the transition
|
||||
// is being computed
|
||||
@@ -538,6 +540,10 @@ func (c *outgoingTransitionContextImpl) DeviceConfig() DeviceConfig {
|
||||
return DeviceConfig{c.bp.Config().(Config).deviceConfig}
|
||||
}
|
||||
|
||||
func (c *outgoingTransitionContextImpl) provider(provider blueprint.AnyProviderKey) (any, bool) {
|
||||
return c.bp.Provider(provider)
|
||||
}
|
||||
|
||||
func (a *androidTransitionMutator) OutgoingTransition(bpctx blueprint.OutgoingTransitionContext, sourceVariation string) string {
|
||||
if m, ok := bpctx.Module().(Module); ok {
|
||||
ctx := outgoingTransitionContextPool.Get().(*outgoingTransitionContextImpl)
|
||||
@@ -569,6 +575,10 @@ func (c *incomingTransitionContextImpl) DeviceConfig() DeviceConfig {
|
||||
return DeviceConfig{c.bp.Config().(Config).deviceConfig}
|
||||
}
|
||||
|
||||
func (c *incomingTransitionContextImpl) provider(provider blueprint.AnyProviderKey) (any, bool) {
|
||||
return c.bp.Provider(provider)
|
||||
}
|
||||
|
||||
func (a *androidTransitionMutator) IncomingTransition(bpctx blueprint.IncomingTransitionContext, incomingVariation string) string {
|
||||
if m, ok := bpctx.Module().(Module); ok {
|
||||
ctx := incomingTransitionContextPool.Get().(*incomingTransitionContextImpl)
|
||||
|
Reference in New Issue
Block a user