public static boolean loadLibrary ( String shortName , int loadFlags ) throws UnsatisfiedLinkError { sSoSourcesLock . readLock ( ) . lock ( ) ; try { if ( sSoSources == null ) { // This should never happen during normal operation, // but if we're running in a non-Android environment, // fall back to System.loadLibrary. if ( "http://www.android.com/" . equals ( System . getProperty ( "java.vendor.url" ) ) ) { // This will throw. assertInitialized ( ) ; } else { // Not on an Android system. Ask the JVM to load for us. synchronized ( SoLoader . class ) { boolean needsLoad = ! sLoadedLibraries . contains ( shortName ) ; if ( needsLoad ) { if ( sSystemLoadLibraryWrapper != null ) { sSystemLoadLibraryWrapper . loadLibrary ( shortName ) ; } else { System . loadLibrary ( shortName ) ; } } return needsLoad ; } } } } finally { sSoSourcesLock . readLock ( ) . unlock ( ) ; } String mergedLibName = MergedSoMapping . mapLibName ( shortName ) ; String soName = mergedLibName != null ? mergedLibName : shortName ; return loadLibraryBySoName ( System . mapLibraryName ( soName ) , shortName , mergedLibName , loadFlags | SoSource . LOAD_FLAG_ALLOW_SOURCE_CHANGE , null ) ; }
Load a shared library initializing any JNI binding it contains .