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

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

Merge "apex.use_vndk_as_stable can't be used with min_sdk_version"

parents 6b9fb9ab 02873da7
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -993,6 +993,9 @@ func (a *apexBundle) ApexInfoMutator(mctx android.TopDownMutatorContext) {
		if !useVndk {
			mctx.PropertyErrorf("use_vndk_as_stable", "not supported for system/system_ext APEXes")
		}
		if a.minSdkVersionValue(mctx) != "" {
			mctx.PropertyErrorf("use_vndk_as_stable", "not supported when min_sdk_version is set")
		}
		mctx.VisitDirectDepsWithTag(sharedLibTag, func(dep android.Module) {
			if c, ok := dep.(*cc.Module); ok && c.IsVndk() {
				mctx.PropertyErrorf("use_vndk_as_stable", "Trying to include a VNDK library(%s) while use_vndk_as_stable is true.", dep.Name())
+19 −1
Original line number Diff line number Diff line
@@ -7880,7 +7880,6 @@ func Test_use_vndk_as_stable_shouldnt_be_used_for_updatable_vendor_apexes(t *tes
			name: "myapex",
			key: "myapex.key",
			updatable: true,
			min_sdk_version: "current",
			use_vndk_as_stable: true,
			soc_specific: true,
		}
@@ -7893,6 +7892,25 @@ func Test_use_vndk_as_stable_shouldnt_be_used_for_updatable_vendor_apexes(t *tes
	`)
}

func Test_use_vndk_as_stable_shouldnt_be_used_with_min_sdk_version(t *testing.T) {
	testApexError(t, `"myapex" .*: use_vndk_as_stable: not supported when min_sdk_version is set`, `
		apex {
			name: "myapex",
			key: "myapex.key",
			updatable: false,
			min_sdk_version: "29",
			use_vndk_as_stable: true,
			vendor: true,
		}

		apex_key {
			name: "myapex.key",
			public_key: "testkey.avbpubkey",
			private_key: "testkey.pem",
		}
	`)
}

func Test_use_vndk_as_stable_shouldnt_be_used_for_non_vendor_apexes(t *testing.T) {
	testApexError(t, `"myapex" .*: use_vndk_as_stable: not supported for system/system_ext APEXes`, `
		apex {