Package com.facebook.soloader
Class ApplicationSoSource
java.lang.Object
com.facebook.soloader.SoSource
com.facebook.soloader.ApplicationSoSource
- All Implemented Interfaces:
RecoverableSoSource
SoSource that wraps a DirectorySoSource for the application's nativeLibraryDir.-
Field Summary
Fields inherited from class com.facebook.soloader.SoSource
LOAD_FLAG_ALLOW_IMPLICIT_PROVISION, LOAD_FLAG_ALLOW_SOURCE_CHANGE, LOAD_FLAG_MIN_CUSTOM_FLAG, LOAD_RESULT_IMPLICITLY_PROVIDED, LOAD_RESULT_LOADED, LOAD_RESULT_NOT_FOUND, PREPARE_FLAG_ALLOW_ASYNC_INIT, PREPARE_FLAG_DISABLE_FS_SYNC_JOB, PREPARE_FLAG_FORCE_REFRESH, PREPARE_FLAG_SKIP_BACKUP_SO_SOURCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToLdLibraryPath(Collection<String> paths) Add an element to an LD_LIBRARY_PATH under construction.String[]getLibraryDependencies(String soName) Gets the dependencies of a library if it is found on this SoSourcegetLibraryPath(String soName) Gets the full path of a library if it is found on this SoSource.getName()getSoFileByName(String soName) intloadLibrary(String soName, int loadFlags, android.os.StrictMode.ThreadPolicy threadPolicy) Load a shared library library into this process.recover(android.content.Context context) toString()Return the class name of the actual instance.unpackLibrary(String soName) Ensure that a shared library exists on disk somewhere.Methods inherited from class com.facebook.soloader.SoSource
getSoSourceAbis
-
Constructor Details
-
ApplicationSoSource
public ApplicationSoSource(android.content.Context context, int flags)
-
-
Method Details
-
loadLibrary
public int loadLibrary(String soName, int loadFlags, android.os.StrictMode.ThreadPolicy threadPolicy) throws IOException Description copied from class:SoSourceLoad a shared library library into this process. This routine is independent ofSoSource.loadLibrary(java.lang.String, int, android.os.StrictMode.ThreadPolicy).- Specified by:
loadLibraryin classSoSource- Parameters:
soName- Name of library to loadloadFlags- Zero or more of the LOAD_FLAG_XXX constants.threadPolicy- Strict Mode policy- Returns:
- One of the LOAD_RESULT_XXX constants.
- Throws:
IOException- IOException
-
getSoFileByName
- Throws:
IOException
-
getLibraryPath
Description copied from class:SoSourceGets the full path of a library if it is found on this SoSource.- Overrides:
getLibraryPathin classSoSource- Parameters:
soName- the full file name of the library- Returns:
- the full path of a library if it is found on this SoSource, null otherwise.
- Throws:
IOException- if there is an error calculatingsoFileName's canonical path
-
getLibraryDependencies
Description copied from class:SoSourceGets the dependencies of a library if it is found on this SoSource- Overrides:
getLibraryDependenciesin classSoSource- Parameters:
soName- Name of library to inspect- Returns:
- An array of library names upon which
soNameneeds for linking - Throws:
IOException- ifsoNameis found but there is an error reading it
-
unpackLibrary
Description copied from class:SoSourceEnsure that a shared library exists on disk somewhere. This routine is independent ofSoSource.loadLibrary(java.lang.String, int, android.os.StrictMode.ThreadPolicy).- Specified by:
unpackLibraryin classSoSource- Parameters:
soName- Name of library to load- Returns:
- File if library found;
nullif not. - Throws:
IOException- IOException
-
addToLdLibraryPath
Description copied from class:SoSourceAdd an element to an LD_LIBRARY_PATH under construction.- Overrides:
addToLdLibraryPathin classSoSource- Parameters:
paths- Collection of paths to which to add
-
getName
-
toString
Description copied from class:SoSourceReturn the class name of the actual instance. Useful for debugging. -
recover
- Specified by:
recoverin interfaceRecoverableSoSource
-