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

Commit 24e716e6 authored by Logan Chien's avatar Logan Chien
Browse files

Allow VNDK extensions under vendor or device

This commit allows VNDK extensions (vndk.enabled:true and vendor:true)
to reside under vendor/* or device/*.  VNDK extensions will be installed
into /vendor/lib[64]/vndk[-sp].  It is reasonable for their source being
under vendor/* or device/*.

Bug: 74506774
Test: lunch aosp_walleye-userdebug && make  # runs unit tests

Merged-In: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
Change-Id: I406c5bef10f5c549371dd978b8ecc16c65a7af4b
parent b1ed497c
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -46,9 +46,15 @@ func registerNeverallowMutator(ctx RegisterMutatorsContext) {
}

var neverallows = []*rule{
	neverallow().in("vendor", "device").with("vndk.enabled", "true").
	neverallow().
		in("vendor", "device").
		with("vndk.enabled", "true").
		without("vendor", "true").
		because("the VNDK can never contain a library that is device dependent."),
	neverallow().with("vndk.enabled", "true").without("owner", "").
	neverallow().
		with("vndk.enabled", "true").
		without("vendor", "true").
		without("owner", "").
		because("a VNDK module can never have an owner."),
	neverallow().notIn("libcore").with("no_standard_libs", "true"),

+22 −0
Original line number Diff line number Diff line
@@ -53,6 +53,28 @@ var neverallowTests = []struct {
		},
		expectedError: "VNDK can never contain a library that is device dependent",
	},
	{
		name: "vndk-ext under vendor or device directory",
		fs: map[string][]byte{
			"device/Blueprints": []byte(`
				cc_library {
					name: "libvndk1_ext",
					vendor: true,
					vndk: {
						enabled: true,
					},
				}`),
			"vendor/Blueprints": []byte(`
				cc_library {
					name: "libvndk2_ext",
					vendor: true,
					vndk: {
						enabled: true,
					},
				}`),
		},
		expectedError: "",
	},

	{
		name: "no enforce_vintf_manifest.cflags",