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

Commit 8c535dad authored by Paul Duffin's avatar Paul Duffin
Browse files

Allow apex dependencies to be restricted to source modules only

An upcoming change to create a prebuilt_platform_compat_config module
will break if the apex tries to use it instead of a
platform_compat_config because the former does not provide all the
information that the apex needs. This change will allow the
compatConfigsTag to be configured to prevent the prebuilt from being
used even when it is preferred.

Bug: 182402754
Test: m nothing
Change-Id: Ib9dc06c038f7cf3fc229f3c4d2b025335a4715b4
parent 29072a9c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -549,8 +549,19 @@ type dependencyTag struct {
	// Determines if the dependent will be part of the APEX payload. Can be false for the
	// dependencies to the signing key module, etc.
	payload bool

	// True if the dependent can only be a source module, false if a prebuilt module is a suitable
	// replacement. This is needed because some prebuilt modules do not provide all the information
	// needed by the apex.
	sourceOnly bool
}

func (d dependencyTag) ReplaceSourceWithPrebuilt() bool {
	return !d.sourceOnly
}

var _ android.ReplaceSourceWithPrebuilt = &dependencyTag{}

var (
	androidAppTag    = dependencyTag{name: "androidApp", payload: true}
	bpfTag           = dependencyTag{name: "bpf", payload: true}