Extend tests to try loading private libs through product and vendor
shared libs.
Both product and vendor shared libs can already load native libs in
their own partitions, so no libnativeloader change is necessary.
Test: atest libnativeloader_e2e_tests
Bug: 237577392
Change-Id: Icd5926044be1b08a0b66ec4a0f2cacc9848cb29d
diff --git a/libnativeloader/test/Android.bp b/libnativeloader/test/Android.bp
index 1d3a07a..4276467 100644
--- a/libnativeloader/test/Android.bp
+++ b/libnativeloader/test/Android.bp
@@ -62,6 +62,24 @@
srcs: ["src/android/test/systemextsharedlib/SystemExtSharedLib.java"],
}
+// Test fixture that represents a shared library in /product/framework.
+java_library {
+ name: "libnativeloader_product_shared_lib",
+ product_specific: true,
+ sdk_version: "33",
+ installable: true,
+ srcs: ["src/android/test/productsharedlib/ProductSharedLib.java"],
+}
+
+// Test fixture that represents a shared library in /vendor/framework.
+java_library {
+ name: "libnativeloader_vendor_shared_lib",
+ vendor: true,
+ sdk_version: "33",
+ installable: true,
+ srcs: ["src/android/test/vendorsharedlib/VendorSharedLib.java"],
+}
+
java_defaults {
name: "loadlibrarytest_app_defaults",
defaults: ["art_module_source_build_java_defaults"],
@@ -73,6 +91,8 @@
libs: [
"libnativeloader_system_shared_lib",
"libnativeloader_system_ext_shared_lib",
+ "libnativeloader_product_shared_lib",
+ "libnativeloader_vendor_shared_lib",
],
}
@@ -136,6 +156,8 @@
":library_container_app",
":libnativeloader_system_shared_lib",
":libnativeloader_system_ext_shared_lib",
+ ":libnativeloader_product_shared_lib",
+ ":libnativeloader_vendor_shared_lib",
":loadlibrarytest_system_priv_app",
":loadlibrarytest_system_app",
":loadlibrarytest_system_ext_app",
diff --git a/libnativeloader/test/libnativeloader_e2e_tests.xml b/libnativeloader/test/libnativeloader_e2e_tests.xml
index b1333b0..f121dca 100644
--- a/libnativeloader/test/libnativeloader_e2e_tests.xml
+++ b/libnativeloader/test/libnativeloader_e2e_tests.xml
@@ -19,6 +19,15 @@
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
+ <!-- Vendor native libraries aren't accessible by any apps by sepolicy
+ rules. For that they need to be labelled same_process_hal_file in a
+ vendor specific file_contexts file (see
+ https://source.android.com/docs/core/permissions/namespaces_libraries#adding-additional-native-libraries).
+ To avoid setting that up to test loading libvendor_private*.so, disable
+ sepolicy checks while running the tests. It's libnativeloader logic we
+ want to test here. -->
+ <target_preparer class="com.android.tradefed.targetprep.DisableSELinuxTargetPreparer"/>
+
<test class="com.android.tradefed.testtype.HostTest" >
<option name="jar" value="libnativeloader_e2e_tests.jar" />
</test>
diff --git a/libnativeloader/test/loadlibrarytest_data_app_manifest.xml b/libnativeloader/test/loadlibrarytest_data_app_manifest.xml
index 2af0af4..7b037c7 100644
--- a/libnativeloader/test/loadlibrarytest_data_app_manifest.xml
+++ b/libnativeloader/test/loadlibrarytest_data_app_manifest.xml
@@ -20,8 +20,10 @@
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.test.app.data" />
<application>
- <uses-library android:name="android.test.systemsharedlib" />
- <uses-library android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.productsharedlib" />
+ <uses-library android:required="false" android:name="android.test.vendorsharedlib" />
<uses-native-library android:required="false" android:name="libfoo.oem1.so" />
<uses-native-library android:required="false" android:name="libbar.oem1.so" />
<uses-native-library android:required="false" android:name="libfoo.oem2.so" />
diff --git a/libnativeloader/test/loadlibrarytest_product_app_manifest.xml b/libnativeloader/test/loadlibrarytest_product_app_manifest.xml
index 614f33f..38bc855 100644
--- a/libnativeloader/test/loadlibrarytest_product_app_manifest.xml
+++ b/libnativeloader/test/loadlibrarytest_product_app_manifest.xml
@@ -20,8 +20,10 @@
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.test.app.product" />
<application>
- <uses-library android:name="android.test.systemsharedlib" />
- <uses-library android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.productsharedlib" />
+ <uses-library android:required="false" android:name="android.test.vendorsharedlib" />
<uses-native-library android:required="false" android:name="libfoo.oem1.so" />
<uses-native-library android:required="false" android:name="libbar.oem1.so" />
<uses-native-library android:required="false" android:name="libfoo.oem2.so" />
diff --git a/libnativeloader/test/loadlibrarytest_system_app_manifest.xml b/libnativeloader/test/loadlibrarytest_system_app_manifest.xml
index 5711f65..5adf527 100644
--- a/libnativeloader/test/loadlibrarytest_system_app_manifest.xml
+++ b/libnativeloader/test/loadlibrarytest_system_app_manifest.xml
@@ -20,10 +20,12 @@
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.test.app.system" />
<application>
- <uses-library android:name="android.test.systemsharedlib" />
- <uses-library android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.productsharedlib" />
+ <uses-library android:required="false" android:name="android.test.vendorsharedlib" />
<!-- System apps get a shared classloader namespace, so they don't need
- uses-native-library entries for anything in /system. -->
+ uses-native-library entries for anything in /system or /system_ext. -->
<uses-native-library android:required="false" android:name="libfoo.product1.so" />
<uses-native-library android:required="false" android:name="libbar.product1.so" />
</application>
diff --git a/libnativeloader/test/loadlibrarytest_system_ext_app_manifest.xml b/libnativeloader/test/loadlibrarytest_system_ext_app_manifest.xml
index 8aa3fa9..34ebda6 100644
--- a/libnativeloader/test/loadlibrarytest_system_ext_app_manifest.xml
+++ b/libnativeloader/test/loadlibrarytest_system_ext_app_manifest.xml
@@ -20,10 +20,12 @@
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.test.app.system_ext" />
<application>
- <uses-library android:name="android.test.systemsharedlib" />
- <uses-library android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.productsharedlib" />
+ <uses-library android:required="false" android:name="android.test.vendorsharedlib" />
<!-- System apps get a shared classloader namespace, so they don't need
- uses-native-library entries for anything in /system. -->
+ uses-native-library entries for anything in /system or /system_ext. -->
<uses-native-library android:required="false" android:name="libfoo.product1.so" />
<uses-native-library android:required="false" android:name="libbar.product1.so" />
</application>
diff --git a/libnativeloader/test/loadlibrarytest_system_priv_app_manifest.xml b/libnativeloader/test/loadlibrarytest_system_priv_app_manifest.xml
index 126453c..fa422a5 100644
--- a/libnativeloader/test/loadlibrarytest_system_priv_app_manifest.xml
+++ b/libnativeloader/test/loadlibrarytest_system_priv_app_manifest.xml
@@ -20,8 +20,10 @@
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.test.app.system_priv" />
<application>
- <uses-library android:name="android.test.systemsharedlib" />
- <uses-library android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.productsharedlib" />
+ <uses-library android:required="false" android:name="android.test.vendorsharedlib" />
<!-- System apps get a shared classloader namespace, so they don't need
uses-native-library entries for anything in /system. -->
<uses-native-library android:required="false" android:name="libfoo.product1.so" />
diff --git a/libnativeloader/test/loadlibrarytest_vendor_app_manifest.xml b/libnativeloader/test/loadlibrarytest_vendor_app_manifest.xml
index a2a9f64..0202945 100644
--- a/libnativeloader/test/loadlibrarytest_vendor_app_manifest.xml
+++ b/libnativeloader/test/loadlibrarytest_vendor_app_manifest.xml
@@ -20,8 +20,10 @@
<instrumentation android:name="androidx.test.runner.AndroidJUnitRunner"
android:targetPackage="android.test.app.vendor" />
<application>
- <uses-library android:name="android.test.systemsharedlib" />
- <uses-library android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemsharedlib" />
+ <uses-library android:required="false" android:name="android.test.systemextsharedlib" />
+ <uses-library android:required="false" android:name="android.test.productsharedlib" />
+ <uses-library android:required="false" android:name="android.test.vendorsharedlib" />
<uses-native-library android:required="false" android:name="libfoo.oem1.so" />
<uses-native-library android:required="false" android:name="libbar.oem1.so" />
<uses-native-library android:required="false" android:name="libfoo.oem2.so" />
diff --git a/libnativeloader/test/src/android/test/app/DataAppTest.java b/libnativeloader/test/src/android/test/app/DataAppTest.java
index 767a7b1..922565e 100644
--- a/libnativeloader/test/src/android/test/app/DataAppTest.java
+++ b/libnativeloader/test/src/android/test/app/DataAppTest.java
@@ -17,14 +17,16 @@
package android.test.app;
import android.test.lib.TestUtils;
+import android.test.productsharedlib.ProductSharedLib;
import android.test.systemextsharedlib.SystemExtSharedLib;
import android.test.systemsharedlib.SystemSharedLib;
-import androidx.test.filters.SmallTest;
+import android.test.vendorsharedlib.VendorSharedLib;
+import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class DataAppTest {
@Test
@@ -61,4 +63,22 @@
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"));
+ 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");
+ }
}
diff --git a/libnativeloader/test/src/android/test/app/ProductAppTest.java b/libnativeloader/test/src/android/test/app/ProductAppTest.java
index 1f36798..7714e10 100644
--- a/libnativeloader/test/src/android/test/app/ProductAppTest.java
+++ b/libnativeloader/test/src/android/test/app/ProductAppTest.java
@@ -17,14 +17,16 @@
package android.test.app;
import android.test.lib.TestUtils;
+import android.test.productsharedlib.ProductSharedLib;
import android.test.systemextsharedlib.SystemExtSharedLib;
import android.test.systemsharedlib.SystemSharedLib;
-import androidx.test.filters.SmallTest;
+import android.test.vendorsharedlib.VendorSharedLib;
+import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class ProductAppTest {
@Test
@@ -61,4 +63,22 @@
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"));
+ 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");
+ }
}
diff --git a/libnativeloader/test/src/android/test/app/SystemAppTest.java b/libnativeloader/test/src/android/test/app/SystemAppTest.java
index 197a40c..7c78e1b 100644
--- a/libnativeloader/test/src/android/test/app/SystemAppTest.java
+++ b/libnativeloader/test/src/android/test/app/SystemAppTest.java
@@ -17,15 +17,17 @@
package android.test.app;
import android.test.lib.TestUtils;
+import android.test.productsharedlib.ProductSharedLib;
import android.test.systemextsharedlib.SystemExtSharedLib;
import android.test.systemsharedlib.SystemSharedLib;
-import androidx.test.filters.SmallTest;
+import android.test.vendorsharedlib.VendorSharedLib;
+import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
// These tests are run from /system/app, /system/priv-app, and /system_ext/app.
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class SystemAppTest {
@Test
@@ -61,4 +63,20 @@
TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("product_private3"));
TestUtils.assertLibraryNotFound(() -> SystemExtSharedLib.loadLibrary("vendor_private3"));
}
+
+ @Test
+ public void testLoadPrivateLibrariesViaProductSharedLib() {
+ ProductSharedLib.loadLibrary("system_private4");
+ ProductSharedLib.loadLibrary("systemext_private4");
+ TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("product_private4"));
+ TestUtils.assertLibraryNotFound(() -> ProductSharedLib.loadLibrary("vendor_private4"));
+ }
+
+ @Test
+ public void testLoadPrivateLibrariesViaVendorSharedLib() {
+ VendorSharedLib.loadLibrary("system_private5");
+ VendorSharedLib.loadLibrary("systemext_private5");
+ TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("product_private5"));
+ TestUtils.assertLibraryNotFound(() -> VendorSharedLib.loadLibrary("vendor_private5"));
+ }
}
diff --git a/libnativeloader/test/src/android/test/app/VendorAppTest.java b/libnativeloader/test/src/android/test/app/VendorAppTest.java
index c9ce8db..0a392c1 100644
--- a/libnativeloader/test/src/android/test/app/VendorAppTest.java
+++ b/libnativeloader/test/src/android/test/app/VendorAppTest.java
@@ -17,14 +17,16 @@
package android.test.app;
import android.test.lib.TestUtils;
+import android.test.productsharedlib.ProductSharedLib;
import android.test.systemextsharedlib.SystemExtSharedLib;
import android.test.systemsharedlib.SystemSharedLib;
-import androidx.test.filters.SmallTest;
+import android.test.vendorsharedlib.VendorSharedLib;
+import androidx.test.filters.MediumTest;
import androidx.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
-@SmallTest
+@MediumTest
@RunWith(AndroidJUnit4.class)
public class VendorAppTest {
@Test
@@ -42,11 +44,7 @@
TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("system_private1"));
TestUtils.assertLinkerNamespaceError(() -> System.loadLibrary("systemext_private1"));
TestUtils.assertLibraryNotFound(() -> System.loadLibrary("product_private1"));
- // TODO(mast): The vendor app fails to load a private vendor library because it gets
- // classified as untrusted_app in SELinux, which doesn't have access to vendor_file. Even an
- // app in /vendor/priv-app, which gets classified as priv_app, still doesn't have access to
- // vendor_file. Check that the test setup is correct and if this is WAI.
- TestUtils.assertLibraryNotFound(() -> System.loadLibrary("vendor_private1"));
+ System.loadLibrary("vendor_private1");
}
@Test
@@ -64,4 +62,22 @@
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"));
+ 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");
+ }
}
diff --git a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
index ffefa4c..3e96df2 100644
--- a/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
+++ b/libnativeloader/test/src/android/test/hostside/LibnativeloaderTest.java
@@ -69,10 +69,14 @@
ctx.pushExtendedPublicProductLibs(libApk);
ctx.pushPrivateLibs(libApk);
}
- ctx.pushSystemSharedLib("/system/framework", "android.test.systemsharedlib",
- "libnativeloader_system_shared_lib.jar");
- ctx.pushSystemSharedLib("/system_ext/framework", "android.test.systemextsharedlib",
+ ctx.pushSharedLib(
+ "/system", "android.test.systemsharedlib", "libnativeloader_system_shared_lib.jar");
+ ctx.pushSharedLib("/system_ext", "android.test.systemextsharedlib",
"libnativeloader_system_ext_shared_lib.jar");
+ ctx.pushSharedLib("/product", "android.test.productsharedlib",
+ "libnativeloader_product_shared_lib.jar");
+ ctx.pushSharedLib(
+ "/vendor", "android.test.vendorsharedlib", "libnativeloader_vendor_shared_lib.jar");
// "Install" apps in various partitions through plain adb push followed by a soft reboot. We
// need them in these locations to test library loading restrictions, so for all except
@@ -98,19 +102,21 @@
// For testDataApp. Install this the normal way after the system server restart.
ctx.installPackage("loadlibrarytest_data_app");
+ ctx.assertCommandSucceeds("setenforce 0");
testInfo.properties().put(CLEANUP_PATHS_KEY, ctx.mCleanup.getPathList());
}
@AfterClassWithInfo
public static void afterClassWithDevice(TestInformation testInfo) throws Exception {
- ITestDevice device = testInfo.getDevice();
+ DeviceContext ctx = new DeviceContext(
+ testInfo.getContext(), testInfo.getDevice(), testInfo.getBuildInfo());
// Uninstall loadlibrarytest_data_app.
- device.uninstallPackage("android.test.app.data");
+ ctx.mDevice.uninstallPackage("android.test.app.data");
String cleanupPathList = testInfo.properties().get(CLEANUP_PATHS_KEY);
- CleanupPaths cleanup = new CleanupPaths(device, cleanupPathList);
+ CleanupPaths cleanup = new CleanupPaths(ctx.mDevice, cleanupPathList);
cleanup.cleanup();
}
@@ -190,7 +196,7 @@
}
}
- // Class for code that needs an ITestDevice. It is instantiated both in tests and in
+ // Class for code that needs an ITestDevice. It may be instantiated both in tests and in
// (Before|After)ClassWithInfo.
private static class DeviceContext implements AutoCloseable {
IInvocationContext mContext;
@@ -233,7 +239,7 @@
void pushPrivateLibs(ZipFile libApk) throws Exception {
// Push the libraries once for each test. Since we cannot unload them, we need a fresh
// never-before-loaded library in each loadLibrary call.
- for (int i = 1; i <= 3; ++i) {
+ for (int i = 1; i <= 5; ++i) {
pushNativeTestLib(libApk, "/system/${LIB}/libsystem_private" + i + ".so");
pushNativeTestLib(libApk, "/system_ext/${LIB}/libsystemext_private" + i + ".so");
pushNativeTestLib(libApk, "/product/${LIB}/libproduct_private" + i + ".so");
@@ -241,14 +247,18 @@
}
}
- void pushSystemSharedLib(String packageDir, String packageName, String buildJarName)
+ void pushSharedLib(String partitionDir, String packageName, String buildJarName)
throws Exception {
- String path = packageDir + "/" + packageName + ".jar";
+ String path = partitionDir + "/framework/" + packageName + ".jar";
pushFile(buildJarName, path);
+ // This permissions xml file is necessary to make it possible to depend on the shared
+ // library from the test app, even if it's in the same partition. It makes the library
+ // public to apps in other partitions as well, which is more than we need, but that
+ // being the case we test all shared libraries from all apps.
pushString("<permissions>\n"
+ "<library name=\"" + packageName + "\" file=\"" + path + "\" />\n"
+ "</permissions>\n",
- "system/etc/permissions/" + packageName + ".xml");
+ partitionDir + "/etc/permissions/" + packageName + ".xml");
}
void softReboot() throws DeviceNotAvailableException {
diff --git a/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java b/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java
new file mode 100644
index 0000000..a500d2a
--- /dev/null
+++ b/libnativeloader/test/src/android/test/productsharedlib/ProductSharedLib.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.test.productsharedlib;
+
+public final class ProductSharedLib {
+ public static void loadLibrary(String name) { System.loadLibrary(name); }
+}
diff --git a/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java b/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java
new file mode 100644
index 0000000..8859b63
--- /dev/null
+++ b/libnativeloader/test/src/android/test/vendorsharedlib/VendorSharedLib.java
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.test.vendorsharedlib;
+
+public final class VendorSharedLib {
+ public static void loadLibrary(String name) { System.loadLibrary(name); }
+}