@ Nullable public boolean loadLibraries ( ) { synchronized ( mLock ) { if ( mLoadLibraries == false ) { return mLibrariesLoaded ; } try { if ( mLibraryNames != null ) { for ( String name : mLibraryNames ) { SoLoader . loadLibrary ( name ) ; } } initialNativeCheck ( ) ; mLibrariesLoaded = true ; mLibraryNames = null ; } catch ( UnsatisfiedLinkError error ) { Log . e ( TAG , "Failed to load native lib (initial check): " , error ) ; mLinkError = error ; mLibrariesLoaded = false ; } catch ( Throwable other ) { Log . e ( TAG , "Failed to load native lib (other error): " , other ) ; mLinkError = new UnsatisfiedLinkError ( "Failed loading libraries" ) ; mLinkError . initCause ( other ) ; mLibrariesLoaded = false ; } mLoadLibraries = false ; return mLibrariesLoaded ; } }
safe loading of native libs