diff --git a/java/com/facebook/soloader/DirectApkSoSource.java b/java/com/facebook/soloader/DirectApkSoSource.java index 689a676..c631f22 100644 --- a/java/com/facebook/soloader/DirectApkSoSource.java +++ b/java/com/facebook/soloader/DirectApkSoSource.java @@ -154,8 +154,7 @@ private void loadDependencies( if (dependencies != null) { for (String dependency : dependencies) { - SoLoader.loadLibraryBySoName( - dependency, loadFlags | LOAD_FLAG_ALLOW_IMPLICIT_PROVISION, threadPolicy); + SoLoader.loadDependency(dependency, loadFlags, threadPolicy); } } } diff --git a/java/com/facebook/soloader/NativeDeps.java b/java/com/facebook/soloader/NativeDeps.java index e37df91..34199f3 100644 --- a/java/com/facebook/soloader/NativeDeps.java +++ b/java/com/facebook/soloader/NativeDeps.java @@ -62,8 +62,7 @@ public static void loadDependencies( continue; } - SoLoader.loadLibraryBySoName( - dependency, loadFlags | SoSource.LOAD_FLAG_ALLOW_IMPLICIT_PROVISION, threadPolicy); + SoLoader.loadDependency(dependency, loadFlags, threadPolicy); } } diff --git a/java/com/facebook/soloader/SoLoader.java b/java/com/facebook/soloader/SoLoader.java index c139403..c7b63dd 100644 --- a/java/com/facebook/soloader/SoLoader.java +++ b/java/com/facebook/soloader/SoLoader.java @@ -829,9 +829,19 @@ public static boolean loadLibrary(String shortName, int loadFlags) throws Unsati return null; } - /* package */ static void loadLibraryBySoName( + /** + * Load a library that is a dependency of another library by name. A dedicated entry point allows + * SoLoader to optimise recursive calls by assuming that the current platform is Android and merge + * map does not need to be consulted. + * + * @param soName Name of the library to load, as extracted from dynamic section. + * @param loadFlags + * @param oldPolicy + */ + /* package */ static void loadDependency( String soName, int loadFlags, StrictMode.ThreadPolicy oldPolicy) { - loadLibraryBySoNameImpl(soName, null, null, loadFlags, oldPolicy); + loadLibraryBySoNameImpl( + soName, null, null, loadFlags | SoSource.LOAD_FLAG_ALLOW_IMPLICIT_PROVISION, oldPolicy); } private static boolean loadLibraryBySoName(