@ThreadSafe public class DirectApkSoSource extends SoSource implements RecoverableSoSource
SoSource that directly finds shared libraries in a APK. The native libraries must be page
aligned and stored uncompressed in the APK.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| Constructor and Description |
|---|
DirectApkSoSource(android.content.Context context) |
DirectApkSoSource(java.util.Set<java.lang.String> directApkLdPaths) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getLibraryPath(java.lang.String soName)
Gets the full path of a library if it is found on this SoSource.
|
java.lang.String |
getName() |
boolean |
isValid() |
int |
loadLibrary(java.lang.String soName,
int loadFlags,
android.os.StrictMode.ThreadPolicy threadPolicy)
Load a shared library library into this process.
|
SoSource |
recover(android.content.Context context) |
java.lang.String |
toString()
Return the class name of the actual instance.
|
java.io.File |
unpackLibrary(java.lang.String soName)
Ensure that a shared library exists on disk somewhere.
|
addToLdLibraryPath, getLibraryDependencies, getSoSourceAbispublic DirectApkSoSource(android.content.Context context)
public DirectApkSoSource(java.util.Set<java.lang.String> directApkLdPaths)
public int loadLibrary(java.lang.String soName,
int loadFlags,
android.os.StrictMode.ThreadPolicy threadPolicy)
throws java.io.IOException
SoSourceSoSource.loadLibrary(java.lang.String, int, android.os.StrictMode.ThreadPolicy).loadLibrary in class SoSourcesoName - Name of library to loadloadFlags - Zero or more of the LOAD_FLAG_XXX constants.threadPolicy - Strict Mode policyjava.io.IOException - IOExceptionpublic java.io.File unpackLibrary(java.lang.String soName)
throws java.io.IOException
SoSourceSoSource.loadLibrary(java.lang.String, int, android.os.StrictMode.ThreadPolicy).unpackLibrary in class SoSourcesoName - Name of library to loadnull if not.java.io.IOException - IOExceptionpublic boolean isValid()
@Nullable
public java.lang.String getLibraryPath(java.lang.String soName)
throws java.io.IOException
SoSourcegetLibraryPath in class SoSourcesoName - the full file name of the libraryjava.io.IOException - if there is an error calculating soFileName's canonical pathpublic java.lang.String getName()
public java.lang.String toString()
SoSourcepublic SoSource recover(android.content.Context context)
recover in interface RecoverableSoSource