Loading core/java/com/android/internal/os/AppZygoteInit.java +3 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,9 @@ class AppZygoteInit { Log.i(TAG, "Beginning application preload for " + appInfo.packageName); LoadedApk loadedApk = new LoadedApk(null, appInfo, null, null, false, true, false); ClassLoader loader = loadedApk.getClassLoader(); Zygote.allowAppFilesAcrossFork(appInfo); Class<?> cl; Method m; try { Loading core/java/com/android/internal/os/WebViewZygoteInit.java +1 −12 Original line number Diff line number Diff line Loading @@ -78,18 +78,7 @@ class WebViewZygoteInit { ClassLoader loader = loadedApk.getClassLoader(); doPreload(loader, WebViewFactory.getWebViewLibrary(appInfo)); // Add the APK to the Zygote's list of allowed files for children. Zygote.nativeAllowFileAcrossFork(appInfo.sourceDir); if (appInfo.splitSourceDirs != null) { for (String path : appInfo.splitSourceDirs) { Zygote.nativeAllowFileAcrossFork(path); } } if (appInfo.sharedLibraryFiles != null) { for (String path : appInfo.sharedLibraryFiles) { Zygote.nativeAllowFileAcrossFork(path); } } Zygote.allowAppFilesAcrossFork(appInfo); Log.i(TAG, "Application preload done"); } Loading core/java/com/android/internal/os/Zygote.java +22 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.system.OsConstants.O_CLOEXEC; import static com.android.internal.os.ZygoteConnectionConstants.MAX_ZYGOTE_ARGC; import android.content.pm.ApplicationInfo; import android.net.Credentials; import android.net.LocalServerSocket; import android.net.LocalSocket; Loading Loading @@ -369,6 +370,27 @@ public final class Zygote { */ protected static native void nativeAllowFileAcrossFork(String path); /** * Lets children of the zygote inherit open file descriptors that belong to the * ApplicationInfo that is passed in. * * @param appInfo ApplicationInfo of the application */ protected static void allowAppFilesAcrossFork(ApplicationInfo appInfo) { Zygote.nativeAllowFileAcrossFork(appInfo.sourceDir); if (appInfo.splitSourceDirs != null) { for (String path : appInfo.splitSourceDirs) { Zygote.nativeAllowFileAcrossFork(path); } } // As well as its shared libs if (appInfo.sharedLibraryFiles != null) { for (String path : appInfo.sharedLibraryFiles) { Zygote.nativeAllowFileAcrossFork(path); } } } /** * Installs a seccomp filter that limits setresuid()/setresgid() to the passed-in range * @param uidGidMin The smallest allowed uid/gid Loading Loading
core/java/com/android/internal/os/AppZygoteInit.java +3 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,9 @@ class AppZygoteInit { Log.i(TAG, "Beginning application preload for " + appInfo.packageName); LoadedApk loadedApk = new LoadedApk(null, appInfo, null, null, false, true, false); ClassLoader loader = loadedApk.getClassLoader(); Zygote.allowAppFilesAcrossFork(appInfo); Class<?> cl; Method m; try { Loading
core/java/com/android/internal/os/WebViewZygoteInit.java +1 −12 Original line number Diff line number Diff line Loading @@ -78,18 +78,7 @@ class WebViewZygoteInit { ClassLoader loader = loadedApk.getClassLoader(); doPreload(loader, WebViewFactory.getWebViewLibrary(appInfo)); // Add the APK to the Zygote's list of allowed files for children. Zygote.nativeAllowFileAcrossFork(appInfo.sourceDir); if (appInfo.splitSourceDirs != null) { for (String path : appInfo.splitSourceDirs) { Zygote.nativeAllowFileAcrossFork(path); } } if (appInfo.sharedLibraryFiles != null) { for (String path : appInfo.sharedLibraryFiles) { Zygote.nativeAllowFileAcrossFork(path); } } Zygote.allowAppFilesAcrossFork(appInfo); Log.i(TAG, "Application preload done"); } Loading
core/java/com/android/internal/os/Zygote.java +22 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.system.OsConstants.O_CLOEXEC; import static com.android.internal.os.ZygoteConnectionConstants.MAX_ZYGOTE_ARGC; import android.content.pm.ApplicationInfo; import android.net.Credentials; import android.net.LocalServerSocket; import android.net.LocalSocket; Loading Loading @@ -369,6 +370,27 @@ public final class Zygote { */ protected static native void nativeAllowFileAcrossFork(String path); /** * Lets children of the zygote inherit open file descriptors that belong to the * ApplicationInfo that is passed in. * * @param appInfo ApplicationInfo of the application */ protected static void allowAppFilesAcrossFork(ApplicationInfo appInfo) { Zygote.nativeAllowFileAcrossFork(appInfo.sourceDir); if (appInfo.splitSourceDirs != null) { for (String path : appInfo.splitSourceDirs) { Zygote.nativeAllowFileAcrossFork(path); } } // As well as its shared libs if (appInfo.sharedLibraryFiles != null) { for (String path : appInfo.sharedLibraryFiles) { Zygote.nativeAllowFileAcrossFork(path); } } } /** * Installs a seccomp filter that limits setresuid()/setresgid() to the passed-in range * @param uidGidMin The smallest allowed uid/gid Loading