diff options
| author | Patrick Baumann <patb@google.com> | 2018-03-13 14:26:58 -0700 |
|---|---|---|
| committer | Patrick Baumann <patb@google.com> | 2018-04-30 20:33:36 +0000 |
| commit | 1bea237aa296a35c263f0c4965ba0f5a140cd848 (patch) | |
| tree | 1b11564543ab86124636262772e39f6c5be4d1bb /core/java/android/app/ApplicationLoaders.java | |
| parent | 331a22e39a95e335da6f401aa4caee8efb3781de (diff) | |
In place split install native support
This change makes it possible for apps installed with the DONT_KILL flag
set to obtain access to newly installed native libraries while avoiding
double load of existing native libraries prior to the install when
loaded using System.loadLibrary.
Bug: 72047376
Test: manual - used sample app to verify availability of native libs
Change-Id: I331eaa48da1f8dee424584911317ec3fba92f873
Diffstat (limited to 'core/java/android/app/ApplicationLoaders.java')
| -rw-r--r-- | core/java/android/app/ApplicationLoaders.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/java/android/app/ApplicationLoaders.java b/core/java/android/app/ApplicationLoaders.java index 725704422290..0ed50f2bea97 100644 --- a/core/java/android/app/ApplicationLoaders.java +++ b/core/java/android/app/ApplicationLoaders.java @@ -25,6 +25,8 @@ import com.android.internal.os.ClassLoaderFactory; import dalvik.system.PathClassLoader; +import java.util.Collection; + /** @hide */ public class ApplicationLoaders { public static ApplicationLoaders getDefault() { @@ -121,6 +123,17 @@ public class ApplicationLoaders { baseDexClassLoader.addDexPath(dexPath); } + /** + * @hide + */ + void addNative(ClassLoader classLoader, Collection<String> libPaths) { + if (!(classLoader instanceof PathClassLoader)) { + throw new IllegalStateException("class loader is not a PathClassLoader"); + } + final PathClassLoader baseDexClassLoader = (PathClassLoader) classLoader; + baseDexClassLoader.addNativePath(libPaths); + } + private final ArrayMap<String, ClassLoader> mLoaders = new ArrayMap<>(); private static final ApplicationLoaders gApplicationLoaders = new ApplicationLoaders(); |
