Add JNI library loading.
The native methods in FileUtils require the JNI library be loaded.
However, the java_library_static build type is not allowed to have
the jni_libs attribute and therefore not link in libcts_jni. This
means that all android_tests that require the native methods must
have jni_libs:["libcts_jni"] in their own build file. Unfortunately,
there are tests that make use of FileUtils methods but don't need
the native methods. Adding the try-catch around the library loading
allows these tests to make use of the utility methods without
linking the JNI library.
Bug: 139672189
Test: atest android.net.http.cts.HttpResponseCacheTest
Test: atest BatterySavingTestBase
Test: atest CtsAssistTestCases
Test: atest CtsBackgroundRestrictionsTestCases
Test: atest CtsContentCaptureServiceTestCases
Test: atest CtsDatabaseTestCases
Test: atest CtsIncidentHostTestCases
Test: atest CtsMultiUserTestCases
Test: atest CtsSyncAccountAccessOtherCertTestCases
Test: atest LocationAccessCheckTest
Test: atest ProfileScheduledJobHostSideTest
Change-Id: I12560d4c12161e27e6f98776eba3c45ab792facf
1 file changed