diff options
author | 2023-11-09 21:30:49 +0000 | |
---|---|---|
committer | 2023-11-30 19:25:44 +0000 | |
commit | 502d277b38adb65d65ec9c88e8d5317303dc4035 (patch) | |
tree | 5e529de4ecee58f3af08a3bb246039b53c6937ef | |
parent | a82cc6579f83e170722577764df8afae61cbc32b (diff) |
Disable tests for the product partition that fail on S and Sv2.
- Support for public libraries in /product was added with
https://r.android.com/1789089 in T. The ProductAppTest app, being
installed in /product/app, can still access them since it's in the
same partition.
- Apps in /product/app were loaded with shared library namespaces in
S, so we cannot test cases where loading of private product, system,
and system_ext libraries should fail in ProductAppTest.java.
Also use min_sdk_version and a far future target_sdk_version for the
test apps to make them run on both development and release platforms,
without compat mode.
Test: libnativeloader_e2e_tests on S, T, and U in heavy presubmits
Bug: 259700260
Change-Id: I21d785d94132af09305c71ed038c74d7b5d58fcc
6 files changed, 159 insertions, 53 deletions
diff --git a/libnativeloader/test/Android.bp b/libnativeloader/test/Android.bp index fd3f3a1662..68c9126407 100644 --- a/libnativeloader/test/Android.bp +++ b/libnativeloader/test/Android.bp @@ -113,7 +113,12 @@ java_library { java_defaults { name: "loadlibrarytest_app_defaults", defaults: ["art_module_source_build_java_defaults"], - sdk_version: "31", + min_sdk_version: "31", + // Don't let targetSdkVersion become the latest codename, because + // PackageManager refuses to install the app on released platform images + // then, which makes it fail in MTS runs. Otoh, we don't want app compat + // measures getting enabled in these tests, so set some high number. + target_sdk_version: "9999", static_libs: [ "androidx.test.ext.junit", "androidx.test.rules", diff --git a/libnativeloader/test/src/android/test/app/DataAppTest.java b/libnativeloader/test/src/android/test/app/DataAppTest.java index 9403494df6..4ba8afcbd2 100644 --- a/libnativeloader/test/src/android/test/app/DataAppTest.java +++ b/libnativeloader/test/src/android/test/app/DataAppTest.java @@ -36,22 +36,28 @@ public class DataAppTest { System.loadLibrary("system_extpub1.oem1"); TestUtils.assertLinkerNamespaceError( // Missing <uses-native-library>. () -> System.loadLibrary("system_extpub_nouses.oem2")); - System.loadLibrary("product_extpub.product1"); - System.loadLibrary("product_extpub1.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + System.loadLibrary("product_extpub.product1"); + System.loadLibrary("product_extpub1.product1"); + } } @Test public void testLoadPrivateLibraries() { TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1")); TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1")); - TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1")); + } TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1")); } @Test public void testLoadExtendedPublicLibrariesViaSystemSharedLib() { SystemSharedLib.loadLibrary("system_extpub2.oem1"); - SystemSharedLib.loadLibrary("product_extpub2.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + SystemSharedLib.loadLibrary("product_extpub2.product1"); + } } @Test @@ -60,7 +66,9 @@ public class DataAppTest { // ought to work. // SystemSharedLib.loadLibrary("system_private2"); // SystemSharedLib.loadLibrary("systemext_private2"); - TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + } TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2")); } @@ -70,7 +78,10 @@ public class DataAppTest { // ought to work. // SystemExtSharedLib.loadLibrary("system_private3"); // SystemExtSharedLib.loadLibrary("systemext_private3"); - TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("product_private3")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound( + () -> SystemExtSharedLib.loadLibrary("product_private3")); + } TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3")); } @@ -79,7 +90,9 @@ public class DataAppTest { TestUtils.assertLinkerNamespaceError(() -> ProductSharedLib.loadLibrary("system_private4")); TestUtils.assertLinkerNamespaceError( () -> ProductSharedLib.loadLibrary("systemext_private4")); - ProductSharedLib.loadLibrary("product_private4"); + if (!TestUtils.skipPublicProductLibTests()) { + ProductSharedLib.loadLibrary("product_private4"); + } TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4")); } @@ -88,14 +101,18 @@ public class DataAppTest { TestUtils.assertLinkerNamespaceError(() -> VendorSharedLib.loadLibrary("system_private5")); TestUtils.assertLinkerNamespaceError( () -> VendorSharedLib.loadLibrary("systemext_private5")); - TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + } VendorSharedLib.loadLibrary("vendor_private5"); } @Test public void testLoadExtendedPublicLibrariesWithAbsolutePaths() { System.load(TestUtils.libPath("/system", "system_extpub3.oem1")); - System.load(TestUtils.libPath("/product", "product_extpub3.product1")); + if (!TestUtils.skipPublicProductLibTests()) { + System.load(TestUtils.libPath("/product", "product_extpub3.product1")); + } } @Test @@ -104,8 +121,10 @@ public class DataAppTest { () -> System.load(TestUtils.libPath("/system", "system_private6"))); TestUtils.assertLinkerNamespaceError( () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/product", "product_private6"))); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLinkerNamespaceError( + () -> System.load(TestUtils.libPath("/product", "product_private6"))); + } TestUtils.assertLinkerNamespaceError( () -> System.load(TestUtils.libPath("/vendor", "vendor_private6"))); } diff --git a/libnativeloader/test/src/android/test/app/ProductAppTest.java b/libnativeloader/test/src/android/test/app/ProductAppTest.java index 7ec817b642..82d8b6e1f1 100644 --- a/libnativeloader/test/src/android/test/app/ProductAppTest.java +++ b/libnativeloader/test/src/android/test/app/ProductAppTest.java @@ -16,34 +16,49 @@ package android.test.app; +import android.os.Build; +import android.os.SystemProperties; import android.test.lib.TestUtils; import android.test.productsharedlib.ProductSharedLib; import android.test.systemextsharedlib.SystemExtSharedLib; import android.test.systemsharedlib.SystemSharedLib; import android.test.vendorsharedlib.VendorSharedLib; + import androidx.test.filters.MediumTest; import androidx.test.runner.AndroidJUnit4; + import org.junit.Test; import org.junit.runner.RunWith; @MediumTest @RunWith(AndroidJUnit4.class) public class ProductAppTest { + // True if apps in product partitions get shared library namespaces, so we + // cannot test that libs in system and system_ext get blocked. + private static boolean productAppsAreShared() { + return Build.VERSION.SDK_INT <= 34 && // UPSIDE_DOWN_CAKE + SystemProperties.get("ro.product.vndk.version").isEmpty(); + } + @Test public void testLoadExtendedPublicLibraries() { System.loadLibrary("system_extpub.oem1"); System.loadLibrary("system_extpub.oem2"); System.loadLibrary("system_extpub1.oem1"); - TestUtils.assertLinkerNamespaceError( // Missing <uses-native-library>. - () -> System.loadLibrary("system_extpub_nouses.oem2")); + if (!productAppsAreShared()) { + TestUtils.assertLinkerNamespaceError( // Missing <uses-native-library>. + () -> System.loadLibrary("system_extpub_nouses.oem2")); + } System.loadLibrary("product_extpub.product1"); System.loadLibrary("product_extpub1.product1"); } @Test public void testLoadPrivateLibraries() { - TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1")); - TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1")); + if (!productAppsAreShared()) { + TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1")); + TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1")); + } System.loadLibrary("product_private1"); TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1")); } @@ -51,7 +66,9 @@ public class ProductAppTest { @Test public void testLoadExtendedPublicLibrariesViaSystemSharedLib() { SystemSharedLib.loadLibrary("system_extpub2.oem1"); - SystemSharedLib.loadLibrary("product_extpub2.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + SystemSharedLib.loadLibrary("product_extpub2.product1"); + } } @Test @@ -60,7 +77,9 @@ public class ProductAppTest { // ought to work. // SystemSharedLib.loadLibrary("system_private2"); // SystemSharedLib.loadLibrary("systemext_private2"); - TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + if (!productAppsAreShared()) { + TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + } TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2")); } @@ -70,26 +89,39 @@ public class ProductAppTest { // ought to work. // SystemExtSharedLib.loadLibrary("system_private3"); // SystemExtSharedLib.loadLibrary("systemext_private3"); - TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("product_private3")); + if (!productAppsAreShared()) { + TestUtils.assertLibraryNotFound( + () -> SystemExtSharedLib.loadLibrary("product_private3")); + } TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3")); } @Test public void testLoadPrivateLibrariesViaProductSharedLib() { - TestUtils.assertLinkerNamespaceError(() -> ProductSharedLib.loadLibrary("system_private4")); - TestUtils.assertLinkerNamespaceError( - () -> ProductSharedLib.loadLibrary("systemext_private4")); + if (!productAppsAreShared()) { + TestUtils.assertLinkerNamespaceError( + () -> ProductSharedLib.loadLibrary("system_private4")); + TestUtils.assertLinkerNamespaceError( + () -> ProductSharedLib.loadLibrary("systemext_private4")); + } ProductSharedLib.loadLibrary("product_private4"); TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4")); } @Test public void testLoadPrivateLibrariesViaVendorSharedLib() { - TestUtils.assertLinkerNamespaceError(() -> VendorSharedLib.loadLibrary("system_private5")); - TestUtils.assertLinkerNamespaceError( - () -> VendorSharedLib.loadLibrary("systemext_private5")); - TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); - VendorSharedLib.loadLibrary("vendor_private5"); + if (!productAppsAreShared()) { + TestUtils.assertLinkerNamespaceError( + () -> VendorSharedLib.loadLibrary("system_private5")); + TestUtils.assertLinkerNamespaceError( + () -> VendorSharedLib.loadLibrary("systemext_private5")); + TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + // When the app has a shared namespace, its libraries get loaded + // with shared namespaces as well, inheriting the same paths. So + // since the app wouldn't have access to /vendor/${LIB}, + // VendorSharedLib here wouldn't either, and this would fail. + VendorSharedLib.loadLibrary("vendor_private5"); + } } @Test @@ -100,10 +132,12 @@ public class ProductAppTest { @Test public void testLoadPrivateLibrariesWithAbsolutePaths() { - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system", "system_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); + if (!productAppsAreShared()) { + TestUtils.assertLinkerNamespaceError( + () -> System.load(TestUtils.libPath("/system", "system_private6"))); + TestUtils.assertLinkerNamespaceError( + () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); + } System.load(TestUtils.libPath("/product", "product_private6")); TestUtils.assertLinkerNamespaceError( () -> System.load(TestUtils.libPath("/vendor", "vendor_private6"))); diff --git a/libnativeloader/test/src/android/test/app/SystemAppTest.java b/libnativeloader/test/src/android/test/app/SystemAppTest.java index cabdfb7e75..a909a4c49d 100644 --- a/libnativeloader/test/src/android/test/app/SystemAppTest.java +++ b/libnativeloader/test/src/android/test/app/SystemAppTest.java @@ -38,29 +38,37 @@ public class SystemAppTest { // Missing <uses-native-library> not relevant for system apps, which have shared classloader // namespaces. System.loadLibrary("system_extpub_nouses.oem2"); - System.loadLibrary("product_extpub.product1"); - System.loadLibrary("product_extpub1.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + System.loadLibrary("product_extpub.product1"); + System.loadLibrary("product_extpub1.product1"); + } } @Test public void testLoadPrivateLibraries() { System.loadLibrary("system_private1"); System.loadLibrary("systemext_private1"); - TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1")); + } TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1")); } @Test public void testLoadExtendedPublicLibrariesViaSystemSharedLib() { SystemSharedLib.loadLibrary("system_extpub2.oem1"); - SystemSharedLib.loadLibrary("product_extpub2.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + SystemSharedLib.loadLibrary("product_extpub2.product1"); + } } @Test public void testLoadPrivateLibrariesViaSystemSharedLib() { SystemSharedLib.loadLibrary("system_private2"); SystemSharedLib.loadLibrary("systemext_private2"); - TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + } TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2")); } @@ -68,7 +76,10 @@ public class SystemAppTest { public void testLoadPrivateLibrariesViaSystemExtSharedLib() { SystemExtSharedLib.loadLibrary("system_private3"); SystemExtSharedLib.loadLibrary("systemext_private3"); - TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("product_private3")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound( + () -> SystemExtSharedLib.loadLibrary("product_private3")); + } TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3")); } @@ -76,7 +87,9 @@ public class SystemAppTest { public void testLoadPrivateLibrariesViaProductSharedLib() { ProductSharedLib.loadLibrary("system_private4"); ProductSharedLib.loadLibrary("systemext_private4"); - TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("product_private4")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("product_private4")); + } TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4")); } @@ -84,22 +97,28 @@ public class SystemAppTest { public void testLoadPrivateLibrariesViaVendorSharedLib() { VendorSharedLib.loadLibrary("system_private5"); VendorSharedLib.loadLibrary("systemext_private5"); - TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + } TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("vendor_private5")); } @Test public void testLoadExtendedPublicLibrariesWithAbsolutePaths() { System.load(TestUtils.libPath("/system", "system_extpub3.oem1")); - System.load(TestUtils.libPath("/product", "product_extpub3.product1")); + if (!TestUtils.skipPublicProductLibTests()) { + System.load(TestUtils.libPath("/product", "product_extpub3.product1")); + } } @Test public void testLoadPrivateLibrariesWithAbsolutePaths() { System.load(TestUtils.libPath("/system", "system_private6")); System.load(TestUtils.libPath("/system_ext", "systemext_private6")); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/product", "product_private6"))); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLinkerNamespaceError( + () -> System.load(TestUtils.libPath("/product", "product_private6"))); + } TestUtils.assertLinkerNamespaceError( () -> System.load(TestUtils.libPath("/vendor", "vendor_private6"))); } diff --git a/libnativeloader/test/src/android/test/app/VendorAppTest.java b/libnativeloader/test/src/android/test/app/VendorAppTest.java index 10d0ea04ee..52688bbf35 100644 --- a/libnativeloader/test/src/android/test/app/VendorAppTest.java +++ b/libnativeloader/test/src/android/test/app/VendorAppTest.java @@ -35,22 +35,28 @@ public class VendorAppTest { TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub.oem2")); TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub1.oem1")); TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_extpub_nouses.oem2")); - System.loadLibrary("product_extpub.product1"); - System.loadLibrary("product_extpub1.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + System.loadLibrary("product_extpub.product1"); + System.loadLibrary("product_extpub1.product1"); + } } @Test public void testLoadPrivateLibraries() { TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1")); TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1")); - TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1")); + } System.loadLibrary("vendor_private1"); } @Test public void testLoadExtendedPublicLibrariesViaSystemSharedLib() { SystemSharedLib.loadLibrary("system_extpub2.oem1"); - SystemSharedLib.loadLibrary("product_extpub2.product1"); + if (!TestUtils.skipPublicProductLibTests()) { + SystemSharedLib.loadLibrary("product_extpub2.product1"); + } } @Test @@ -59,7 +65,9 @@ public class VendorAppTest { // ought to work. // SystemSharedLib.loadLibrary("system_private2"); // SystemSharedLib.loadLibrary("systemext_private2"); - TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("product_private2")); + } TestUtils.assertLibraryNotFound(() -> SystemSharedLib.loadLibrary("vendor_private2")); } @@ -69,7 +77,10 @@ public class VendorAppTest { // ought to work. // SystemExtSharedLib.loadLibrary("system_private3"); // SystemExtSharedLib.loadLibrary("systemext_private3"); - TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("product_private3")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound( + () -> SystemExtSharedLib.loadLibrary("product_private3")); + } TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3")); } @@ -78,7 +89,9 @@ public class VendorAppTest { TestUtils.assertLinkerNamespaceError(() -> ProductSharedLib.loadLibrary("system_private4")); TestUtils.assertLinkerNamespaceError( () -> ProductSharedLib.loadLibrary("systemext_private4")); - ProductSharedLib.loadLibrary("product_private4"); + if (!TestUtils.skipPublicProductLibTests()) { + ProductSharedLib.loadLibrary("product_private4"); + } TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4")); } @@ -87,7 +100,9 @@ public class VendorAppTest { TestUtils.assertLinkerNamespaceError(() -> VendorSharedLib.loadLibrary("system_private5")); TestUtils.assertLinkerNamespaceError( () -> VendorSharedLib.loadLibrary("systemext_private5")); - TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5")); + } VendorSharedLib.loadLibrary("vendor_private5"); } @@ -95,7 +110,9 @@ public class VendorAppTest { public void testLoadExtendedPublicLibrariesWithAbsolutePaths() { TestUtils.assertLinkerNamespaceError( () -> System.load(TestUtils.libPath("/system", "system_extpub3.oem1"))); - System.load(TestUtils.libPath("/product", "product_extpub3.product1")); + if (!TestUtils.skipPublicProductLibTests()) { + System.load(TestUtils.libPath("/product", "product_extpub3.product1")); + } } @Test @@ -104,8 +121,10 @@ public class VendorAppTest { () -> System.load(TestUtils.libPath("/system", "system_private6"))); TestUtils.assertLinkerNamespaceError( () -> System.load(TestUtils.libPath("/system_ext", "systemext_private6"))); - TestUtils.assertLinkerNamespaceError( - () -> System.load(TestUtils.libPath("/product", "product_private6"))); + if (!TestUtils.skipPublicProductLibTests()) { + TestUtils.assertLinkerNamespaceError( + () -> System.load(TestUtils.libPath("/product", "product_private6"))); + } System.load(TestUtils.libPath("/vendor", "vendor_private6")); } } diff --git a/libnativeloader/test/src/android/test/lib/TestUtils.java b/libnativeloader/test/src/android/test/lib/TestUtils.java index 1dd917f89f..ca64bad791 100644 --- a/libnativeloader/test/src/android/test/lib/TestUtils.java +++ b/libnativeloader/test/src/android/test/lib/TestUtils.java @@ -17,9 +17,13 @@ package android.test.lib; import static com.google.common.truth.Truth.assertThat; + import static org.junit.Assert.assertThrows; +import android.os.Build; + import androidx.test.platform.app.InstrumentationRegistry; + import org.junit.function.ThrowingRunnable; public final class TestUtils { @@ -38,4 +42,10 @@ public final class TestUtils { String libDirName = InstrumentationRegistry.getArguments().getString("libDirName"); return dir + "/" + libDirName + "/lib" + libName + ".so"; } + + // True if we have to skip testing public libraries in the product + // partition, which got supported in T. + public static boolean skipPublicProductLibTests() { + return Build.VERSION.SDK_INT < 33; // TIRAMISU + } } |