summaryrefslogtreecommitdiff
path: root/core/java/android/app/ApplicationLoaders.java
diff options
context:
space:
mode:
authorPatrick Baumann <patb@google.com>2018-03-13 14:26:58 -0700
committerPatrick Baumann <patb@google.com>2018-04-30 20:33:36 +0000
commit1bea237aa296a35c263f0c4965ba0f5a140cd848 (patch)
tree1b11564543ab86124636262772e39f6c5be4d1bb /core/java/android/app/ApplicationLoaders.java
parent331a22e39a95e335da6f401aa4caee8efb3781de (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.java13
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();