Fix JNI Loading for BuildTest
Bug 2814482
BuildTest uses native code to check the CPU's features. When using
runtest.py, the library is put into /system/lib, so the library is
loaded without problems. However, running the test in CTS causes
the library not to be found, because it is not installed into the
system directory anymore. The CTS runner's classloader is used for
tests, so the native code must be compiled into the runner's jar
in order for it to be found.
Change-Id: I1922d3d2e95753fb0e1dad741178e514695dc1e3
diff --git a/tests/Android.mk b/tests/Android.mk
index 64517af..838d01d 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -24,6 +24,8 @@
LOCAL_JAVA_LIBRARIES := android.test.runner
+LOCAL_JNI_SHARED_LIBRARIES := libcts_jni
+
# Resource unit tests use a private locale and some densities
LOCAL_AAPT_FLAGS = -c xx_YY -c cs -c 32dpi -c 240dpi -c 160dpi