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

Commit ed5dee0a authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

Merge "Add llndk_stubs property"

parents 96497485 0477b422
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ type AndroidMkEntriesProvider interface {
type AndroidMkEntries struct {
	Class           string
	SubName         string
	OverrideName    string
	DistFiles       TaggedDistFiles
	OutputFile      OptionalPath
	Disabled        bool
@@ -273,6 +274,9 @@ func (a *AndroidMkEntries) fillInEntries(config Config, bpPath string, mod bluep
	a.EntryMap = make(map[string][]string)
	amod := mod.(Module).base()
	name := amod.BaseModuleName()
	if a.OverrideName != "" {
		name = a.OverrideName
	}

	if a.Include == "" {
		a.Include = "$(BUILD_PREBUILT)"
+4 −3
Original line number Diff line number Diff line
@@ -2383,11 +2383,12 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
							// system libraries.
							if !am.DirectlyInAnyApex() {
								// we need a module name for Make
								name := cc.BaseModuleName() + cc.Properties.SubName
								if proptools.Bool(a.properties.Use_vendor) {
								name := cc.ImplementationModuleName(ctx)

								if !proptools.Bool(a.properties.Use_vendor) {
									// we don't use subName(.vendor) for a "use_vendor: true" apex
									// which is supposed to be installed in /system
									name = cc.BaseModuleName()
									name += cc.Properties.SubName
								}
								if !android.InList(name, a.requiredDeps) {
									a.requiredDeps = append(a.requiredDeps, name)
+2 −1
Original line number Diff line number Diff line
@@ -1270,10 +1270,11 @@ func TestApexDependsOnLLNDKTransitively(t *testing.T) {
				system_shared_libs: [],
				stl: "none",
				stubs: { versions: ["29","30"] },
				llndk_stubs: "libbar.llndk",
			}

			llndk_library {
				name: "libbar",
				name: "libbar.llndk",
				symbol_file: "",
			}
			`, func(fs map[string][]byte, config android.Config) {
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ var (
)

type AndroidMkContext interface {
	BaseModuleName() string
	Target() android.Target
	subAndroidMk(*android.AndroidMkEntries, interface{})
	Arch() android.Arch
@@ -463,6 +464,7 @@ func (c *stubDecorator) AndroidMkEntries(ctx AndroidMkContext, entries *android.

func (c *llndkStubDecorator) AndroidMkEntries(ctx AndroidMkContext, entries *android.AndroidMkEntries) {
	entries.Class = "SHARED_LIBRARIES"
	entries.OverrideName = c.implementationModuleName(ctx.BaseModuleName())

	entries.ExtraEntries = append(entries.ExtraEntries, func(entries *android.AndroidMkEntries) {
		c.libraryDecorator.androidMkWriteExportedFlags(entries)
+10 −0
Original line number Diff line number Diff line
@@ -1041,6 +1041,16 @@ func (c *Module) HasStubsVariants() bool {
	return false
}

// If this is a stubs library, ImplementationModuleName returns the name of the module that contains
// the implementation.  If it is an implementation library it returns its own name.
func (c *Module) ImplementationModuleName(ctx android.BaseModuleContext) string {
	name := ctx.OtherModuleName(c)
	if versioned, ok := c.linker.(versionedInterface); ok {
		name = versioned.implementationModuleName(name)
	}
	return name
}

func (c *Module) bootstrap() bool {
	return Bool(c.Properties.Bootstrap)
}
Loading