diff options
Diffstat (limited to 'rust/image.go')
-rw-r--r-- | rust/image.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/rust/image.go b/rust/image.go index 3b54f12c7..6a8337692 100644 --- a/rust/image.go +++ b/rust/image.go @@ -50,7 +50,7 @@ func (mod *Module) AndroidModuleBase() *android.ModuleBase { } func (mod *Module) RecoveryAvailable() bool { - return false + return Bool(mod.Properties.Recovery_available) } func (mod *Module) ExtraVariants() []string { @@ -72,9 +72,7 @@ func (mod *Module) SetVendorRamdiskVariantNeeded(b bool) { } func (mod *Module) SetRecoveryVariantNeeded(b bool) { - if b { - panic("Setting recovery variant needed for Rust module is unsupported: " + mod.BaseModuleName()) - } + mod.Properties.RecoveryVariantNeeded = b } func (mod *Module) SetCoreVariantNeeded(b bool) { @@ -107,7 +105,7 @@ func (mod *Module) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool } func (mod *Module) RecoveryVariantNeeded(android.BaseModuleContext) bool { - return mod.InRecovery() + return mod.Properties.RecoveryVariantNeeded } func (mod *Module) ExtraImageVariations(android.BaseModuleContext) []string { @@ -144,8 +142,7 @@ func (ctx *moduleContext) ProductSpecific() bool { } func (mod *Module) InRecovery() bool { - // TODO(b/165791368) - return false + return mod.ModuleBase.InRecovery() || mod.ModuleBase.InstallInRecovery() } func (mod *Module) InVendorRamdisk() bool { @@ -193,6 +190,8 @@ func (mod *Module) SetImageVariation(ctx android.BaseModuleContext, variant stri m := module.(*Module) if variant == android.VendorRamdiskVariation { m.MakeAsPlatform() + } else if variant == android.RecoveryVariation { + m.MakeAsPlatform() } else if strings.HasPrefix(variant, cc.VendorVariationPrefix) { m.Properties.ImageVariationPrefix = cc.VendorVariationPrefix m.Properties.VndkVersion = strings.TrimPrefix(variant, cc.VendorVariationPrefix) |