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

Commit eb18c874 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Add installable property for prebuilt_apex"

parents a0dd6087 dd53e8be
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -1317,6 +1317,12 @@ type PrebuiltProperties struct {
			Src *string
		}
	}

	Installable *bool
}

func (p *Prebuilt) installable() bool {
	return p.properties.Installable == nil || proptools.Bool(p.properties.Installable)
}

func (p *Prebuilt) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -1351,8 +1357,10 @@ func (p *Prebuilt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
	// TODO(jungjw): Check the key validity.
	p.inputApex = p.Prebuilt().SingleSourcePath(ctx)
	p.installDir = android.PathForModuleInstall(ctx, "apex")
	if p.installable() {
		ctx.InstallFile(p.installDir, ctx.ModuleName()+imageApexSuffix, p.inputApex)
	}
}

func (p *Prebuilt) Prebuilt() *android.Prebuilt {
	return &p.prebuilt
@@ -1371,6 +1379,7 @@ func (p *Prebuilt) AndroidMk() android.AndroidMkData {
			func(w io.Writer, outputFile android.Path) {
				fmt.Fprintln(w, "LOCAL_MODULE_PATH :=", filepath.Join("$(OUT_DIR)", p.installDir.RelPathString()))
				fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", p.BaseModuleName()+imageApexSuffix)
				fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !p.installable())
			},
		},
	}