Loading Android.mk +0 −3 Original line number Diff line number Diff line Loading @@ -402,9 +402,6 @@ LOCAL_DX_FLAGS := --core-library --multi-dex LOCAL_RMTYPEDEFS := true # List of classes and interfaces which should be loaded by the Zygote. LOCAL_JAVA_RESOURCE_FILES += $(LOCAL_PATH)/preloaded-classes include $(BUILD_JAVA_LIBRARY) framework_module := $(LOCAL_INSTALLED_MODULE) Loading core/java/com/android/internal/os/ZygoteInit.java +76 −72 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ import libcore.io.IoUtils; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; Loading Loading @@ -97,9 +99,9 @@ public class ZygoteInit { static final int GC_LOOP_COUNT = 10; /** * The name of a resource file that contains classes to preload. * The path of a file that contains classes to preload. */ private static final String PRELOADED_CLASSES = "preloaded-classes"; private static final String PRELOADED_CLASSES = "/system/etc/preloaded-classes"; /** Controls whether we should preload resources during zygote init. */ private static final boolean PRELOAD_RESOURCES = true; Loading Loading @@ -284,11 +286,14 @@ public class ZygoteInit { private static void preloadClasses() { final VMRuntime runtime = VMRuntime.getRuntime(); InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream( PRELOADED_CLASSES); if (is == null) { InputStream is; try { is = new FileInputStream(PRELOADED_CLASSES); } catch (FileNotFoundException e) { Log.e(TAG, "Couldn't find " + PRELOADED_CLASSES + "."); } else { return; } Log.i(TAG, "Preloading classes..."); long startTime = SystemClock.uptimeMillis(); Loading Loading @@ -369,7 +374,6 @@ public class ZygoteInit { setEffectiveGroup(ROOT_GID); } } } /** * Load in commonly used resources, so they can be shared across Loading Loading
Android.mk +0 −3 Original line number Diff line number Diff line Loading @@ -402,9 +402,6 @@ LOCAL_DX_FLAGS := --core-library --multi-dex LOCAL_RMTYPEDEFS := true # List of classes and interfaces which should be loaded by the Zygote. LOCAL_JAVA_RESOURCE_FILES += $(LOCAL_PATH)/preloaded-classes include $(BUILD_JAVA_LIBRARY) framework_module := $(LOCAL_INSTALLED_MODULE) Loading
core/java/com/android/internal/os/ZygoteInit.java +76 −72 Original line number Diff line number Diff line Loading @@ -45,6 +45,8 @@ import libcore.io.IoUtils; import java.io.BufferedReader; import java.io.FileDescriptor; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; Loading Loading @@ -97,9 +99,9 @@ public class ZygoteInit { static final int GC_LOOP_COUNT = 10; /** * The name of a resource file that contains classes to preload. * The path of a file that contains classes to preload. */ private static final String PRELOADED_CLASSES = "preloaded-classes"; private static final String PRELOADED_CLASSES = "/system/etc/preloaded-classes"; /** Controls whether we should preload resources during zygote init. */ private static final boolean PRELOAD_RESOURCES = true; Loading Loading @@ -284,11 +286,14 @@ public class ZygoteInit { private static void preloadClasses() { final VMRuntime runtime = VMRuntime.getRuntime(); InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream( PRELOADED_CLASSES); if (is == null) { InputStream is; try { is = new FileInputStream(PRELOADED_CLASSES); } catch (FileNotFoundException e) { Log.e(TAG, "Couldn't find " + PRELOADED_CLASSES + "."); } else { return; } Log.i(TAG, "Preloading classes..."); long startTime = SystemClock.uptimeMillis(); Loading Loading @@ -369,7 +374,6 @@ public class ZygoteInit { setEffectiveGroup(ROOT_GID); } } } /** * Load in commonly used resources, so they can be shared across Loading