public abstract class SoSource
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
LOAD_FLAG_ALLOW_IMPLICIT_PROVISION
Allow loadLibrary to implicitly provide the library instead of actually loading it.
|
static int |
LOAD_FLAG_ALLOW_SOURCE_CHANGE
Deprecated.
|
static int |
LOAD_FLAG_MIN_CUSTOM_FLAG
Min flag that can be used in customized
SoFileLoader.load(String, int) implementation. |
static int |
LOAD_RESULT_CORRUPTED_LIB_FILE
This SoSource tried to load the library but it seems that the file is corrupted.
|
static int |
LOAD_RESULT_IMPLICITLY_PROVIDED
This SoSource did not load the library, but verified that the system loader will load it if
some other library depends on it.
|
static int |
LOAD_RESULT_LOADED
This SoSource loaded the given library.
|
static int |
LOAD_RESULT_NOT_FOUND
This SoSource doesn't know how to provide the given library.
|
static int |
PREPARE_FLAG_ALLOW_ASYNC_INIT
Allow prepare to spawn threads to do background work.
|
static int |
PREPARE_FLAG_FORCE_REFRESH
Force prepare to refresh libs.
|
| Constructor and Description |
|---|
SoSource() |
| Modifier and Type | Method and Description |
|---|---|
void |
addToLdLibraryPath(java.util.Collection<java.lang.String> paths)
Add an element to an LD_LIBRARY_PATH under construction.
|
java.lang.String[] |
getLibraryDependencies(java.lang.String soName)
Gets the dependencies of a library if it is found on this SoSource
|
java.lang.String |
getLibraryPath(java.lang.String soFileName)
Gets the full path of a library if it is found on this SoSource.
|
java.lang.String[] |
getSoSourceAbis()
Return an array of ABIs handled by this SoSource.
|
abstract int |
loadLibrary(java.lang.String soName,
int loadFlags,
StrictMode.ThreadPolicy threadPolicy)
Load a shared library library into this process.
|
java.lang.String |
toString()
Return the class name of the actual instance.
|
abstract java.io.File |
unpackLibrary(java.lang.String soName)
Ensure that a shared library exists on disk somewhere.
|
public static final int LOAD_RESULT_NOT_FOUND
public static final int LOAD_RESULT_LOADED
public static final int LOAD_RESULT_IMPLICITLY_PROVIDED
public static final int LOAD_RESULT_CORRUPTED_LIB_FILE
public static final int LOAD_FLAG_ALLOW_IMPLICIT_PROVISION
@Deprecated public static final int LOAD_FLAG_ALLOW_SOURCE_CHANGE
public static final int LOAD_FLAG_MIN_CUSTOM_FLAG
SoFileLoader.load(String, int) implementation.
The custom flag value has to be greater than this.public static final int PREPARE_FLAG_ALLOW_ASYNC_INIT
public static final int PREPARE_FLAG_FORCE_REFRESH
public abstract int loadLibrary(java.lang.String soName,
int loadFlags,
StrictMode.ThreadPolicy threadPolicy)
throws java.io.IOException
loadLibrary(java.lang.String, int, StrictMode.ThreadPolicy).soName - Name of library to loadloadFlags - Zero or more of the LOAD_FLAG_XXX constants.java.io.IOExceptionpublic abstract java.io.File unpackLibrary(java.lang.String soName)
throws java.io.IOException
loadLibrary(java.lang.String, int, StrictMode.ThreadPolicy).soName - Name of library to loadnull if not.java.io.IOExceptionpublic java.lang.String getLibraryPath(java.lang.String soFileName)
throws java.io.IOException
soFileName - the full file name of the libraryjava.io.IOException - if there is an error calculating soFileName's canonical pathpublic java.lang.String[] getLibraryDependencies(java.lang.String soName)
throws java.io.IOException
soName - Name of library to inspectsoName needs for linkingjava.io.IOException - if soName is found but there is an error reading itpublic void addToLdLibraryPath(java.util.Collection<java.lang.String> paths)
paths - Collection of paths to which to addpublic java.lang.String[] getSoSourceAbis()
public java.lang.String toString()
toString in class java.lang.Object