Enforce min_sdk_version of apex(use_vendor:true)

Even though use_vendor:true is prohibited, there is media.swcodec apex
which is still use_vendor: true and also needs to support Android10.
(min_sdk_version: 29)

Because LLNDK stubs were provided only for the current VNDK version,
media.swcodec couldn't be built against min_sdk_version: 29.

This change introduces additional versions for LLNDK stubs which are
enforced when an apex with use_vendor: true sets min_sdk_version.

To make things easier, the versions of LLNDK stubs are borrowed from its
implementation libraries.

Bug: 147450930
Bug: 149591522
Test: TARGET_BUILD_APPS=com.android.media.swcodec m
      (with min_sdk_version: 29 set)
      check if liblog/libc/libm/libdl stubs are 29
      check if 29 stubs don't have new symbols.

Merged-In: I79946cbb4da6617138a96d2b254349d3a298e77b
Change-Id: I79946cbb4da6617138a96d2b254349d3a298e77b
(cherry picked from commit 380fc3615c)
This commit is contained in:
Jooyung Han
2020-03-13 15:23:36 +09:00
parent 89124ba39b
commit 67a96cd7cb
6 changed files with 189 additions and 63 deletions

View File

@@ -2398,6 +2398,34 @@ func checkEquals(t *testing.T, message string, expected, actual interface{}) {
}
}
func TestLlndkLibrary(t *testing.T) {
ctx := testCc(t, `
cc_library {
name: "libllndk",
stubs: { versions: ["1", "2"] },
}
llndk_library {
name: "libllndk",
}
`)
actual := ctx.ModuleVariantsForTests("libllndk.llndk")
expected := []string{
"android_vendor.VER_arm64_armv8-a_shared",
"android_vendor.VER_arm64_armv8-a_shared_1",
"android_vendor.VER_arm64_armv8-a_shared_2",
"android_vendor.VER_arm_armv7-a-neon_shared",
"android_vendor.VER_arm_armv7-a-neon_shared_1",
"android_vendor.VER_arm_armv7-a-neon_shared_2",
}
checkEquals(t, "variants for llndk stubs", expected, actual)
params := ctx.ModuleForTests("libllndk.llndk", "android_vendor.VER_arm_armv7-a-neon_shared").Description("generate stub")
checkEquals(t, "use VNDK version for default stubs", "current", params.Args["apiLevel"])
params = ctx.ModuleForTests("libllndk.llndk", "android_vendor.VER_arm_armv7-a-neon_shared_1").Description("generate stub")
checkEquals(t, "override apiLevel for versioned stubs", "1", params.Args["apiLevel"])
}
func TestLlndkHeaders(t *testing.T) {
ctx := testCc(t, `
llndk_headers {