use_vndk_as_stable APEX shouldn't include VNDK lib

Even though a vendor APEX sets use_vndk_as_stable:true it was possible
to include a VNDK lib by directly depending on it with
native_shared_libs.

But it's contradictory to have a VNDK lib while declaring not to include
VNDK libs. It was missing since pruning dependencies on VNDK libs was
done only for transitive deps.

Added a check to reject this.

Bug: 216847402
Test: m nothing(running soong tests)
Change-Id: I8d79a434b1bfe8e563cf8968fa76830b0e582f66
This commit is contained in:
Jooyung Han
2022-02-04 11:54:50 +09:00
parent 99a81c8dfd
commit c5a967630e
2 changed files with 29 additions and 3 deletions

View File

@@ -2713,6 +2713,23 @@ func TestVendorApex(t *testing.T) {
ensureListNotContains(t, requireNativeLibs, ":vndk")
}
func TestVendorApex_use_vndk_as_stable_TryingToIncludeVNDKLib(t *testing.T) {
testApexError(t, `Trying to include a VNDK library`, `
apex {
name: "myapex",
key: "myapex.key",
native_shared_libs: ["libc++"], // libc++ is a VNDK lib
vendor: true,
use_vndk_as_stable: true,
updatable: false,
}
apex_key {
name: "myapex.key",
public_key: "testkey.avbpubkey",
private_key: "testkey.pem",
}`)
}
func TestVendorApex_use_vndk_as_stable(t *testing.T) {
ctx := testApex(t, `
apex {