Class DirectorySoSource

    • Constructor Detail

      • DirectorySoSource

        public DirectorySoSource​(java.io.File soDirectory,
                                 int flags)
        Make a new DirectorySoSource. If flags contains RESOLVE_DEPENDENCIES, recursively load dependencies for shared objects loaded from this directory. (We shouldn't need to resolve dependencies for libraries loaded from system directories: the dynamic linker is smart enough to do it on its own there.)
        Parameters:
        soDirectory - the dir that contains the so files
        flags - load flags
      • DirectorySoSource

        public DirectorySoSource​(java.io.File soDirectory,
                                 int flags,
                                 java.lang.String[] denyList)
        This method is similar to DirectorySoSource(File, int), with the following differences:
        Parameters:
        soDirectory - the dir that contains the so files
        flags - load flags
        denyList - the soname list that we won't try to load from this source
    • Method Detail

      • loadLibrary

        public int loadLibrary​(java.lang.String soName,
                               int loadFlags,
                               android.os.StrictMode.ThreadPolicy threadPolicy)
                        throws java.io.IOException
        Description copied from class: SoSource
        Load a shared library library into this process. This routine is independent of SoSource.loadLibrary(java.lang.String, int, android.os.StrictMode.ThreadPolicy).
        Specified by:
        loadLibrary in class SoSource
        Parameters:
        soName - Name of library to load
        loadFlags - Zero or more of the LOAD_FLAG_XXX constants.
        threadPolicy - Strict Mode policy
        Returns:
        One of the LOAD_RESULT_XXX constants.
        Throws:
        java.io.IOException - IOException
      • getLibraryPath

        @Nullable
        public java.lang.String getLibraryPath​(java.lang.String soName)
                                        throws java.io.IOException
        Description copied from class: SoSource
        Gets the full path of a library if it is found on this SoSource.
        Overrides:
        getLibraryPath in class SoSource
        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:
        java.io.IOException - if there is an error calculating soFileName's canonical path
      • getLibraryDependencies

        @Nullable
        public java.lang.String[] getLibraryDependencies​(java.lang.String soName)
                                                  throws java.io.IOException
        Description copied from class: SoSource
        Gets the dependencies of a library if it is found on this SoSource
        Overrides:
        getLibraryDependencies in class SoSource
        Parameters:
        soName - Name of library to inspect
        Returns:
        An array of library names upon which soName needs for linking
        Throws:
        java.io.IOException - if soName is found but there is an error reading it
      • addToLdLibraryPath

        public void addToLdLibraryPath​(java.util.Collection<java.lang.String> paths)
        Description copied from class: SoSource
        Add an element to an LD_LIBRARY_PATH under construction.
        Overrides:
        addToLdLibraryPath in class SoSource
        Parameters:
        paths - Collection of paths to which to add
      • toString

        public java.lang.String toString()
        Description copied from class: SoSource
        Return the class name of the actual instance. Useful for debugging.
        Overrides:
        toString in class SoSource
        Returns:
        the instance class name