diff options
author | 2024-10-15 15:22:57 -0700 | |
---|---|---|
committer | 2024-10-21 16:43:17 -0700 | |
commit | fa6e0fdf2fb3b15efceee6261caf69551b01be45 (patch) | |
tree | 32dfe883c67bdfb659175600bb840b2811c2293a /sh | |
parent | bae26fe87f9d05a40accf870fee40d000ad4ed64 (diff) |
Make ImageInterface use its own context
In a followup cl, the ImageInterface will be queried during incoming
transitions, which have a more limited context. Make a dedicated
ImageInterfaceContext so we can have more control about what functions
we expose.
Bug: 372091092
Test: m nothing --no-skip-soong-tests
Change-Id: Idb320352433cda4b0467226599295056ec47025d
Diffstat (limited to 'sh')
-rw-r--r-- | sh/sh_binary.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sh/sh_binary.go b/sh/sh_binary.go index 2e48d83e6..469862d1d 100644 --- a/sh/sh_binary.go +++ b/sh/sh_binary.go @@ -210,41 +210,41 @@ func (s *ShBinary) Symlinks() []string { var _ android.ImageInterface = (*ShBinary)(nil) -func (s *ShBinary) ImageMutatorBegin(ctx android.BaseModuleContext) {} +func (s *ShBinary) ImageMutatorBegin(ctx android.ImageInterfaceContext) {} -func (s *ShBinary) VendorVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) VendorVariantNeeded(ctx android.ImageInterfaceContext) bool { return s.InstallInVendor() } -func (s *ShBinary) ProductVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) ProductVariantNeeded(ctx android.ImageInterfaceContext) bool { return s.InstallInProduct() } -func (s *ShBinary) CoreVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) CoreVariantNeeded(ctx android.ImageInterfaceContext) bool { return !s.InstallInRecovery() && !s.InstallInRamdisk() && !s.InstallInVendorRamdisk() && !s.ModuleBase.InstallInVendor() } -func (s *ShBinary) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) RamdiskVariantNeeded(ctx android.ImageInterfaceContext) bool { return proptools.Bool(s.properties.Ramdisk_available) || s.InstallInRamdisk() } -func (s *ShBinary) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) VendorRamdiskVariantNeeded(ctx android.ImageInterfaceContext) bool { return proptools.Bool(s.properties.Vendor_ramdisk_available) || s.InstallInVendorRamdisk() } -func (s *ShBinary) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) DebugRamdiskVariantNeeded(ctx android.ImageInterfaceContext) bool { return false } -func (s *ShBinary) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool { +func (s *ShBinary) RecoveryVariantNeeded(ctx android.ImageInterfaceContext) bool { return proptools.Bool(s.properties.Recovery_available) || s.InstallInRecovery() } -func (s *ShBinary) ExtraImageVariations(ctx android.BaseModuleContext) []string { +func (s *ShBinary) ExtraImageVariations(ctx android.ImageInterfaceContext) []string { return nil } -func (s *ShBinary) SetImageVariation(ctx android.BaseModuleContext, variation string) { +func (s *ShBinary) SetImageVariation(ctx android.ImageInterfaceContext, variation string) { s.properties.ImageVariation = variation } |