From: Jesse Hall Date: Mon, 12 Dec 2016 05:22:16 +0000 (-0800) Subject: Stop preloading EGL/GLES in Zygote X-Git-Tag: android-x86-8.1-r1~5426^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=9c9cc3e94dd3b07ebf2ab52f1837dd88a64a9b57;p=android-x86%2Fframeworks-base.git Stop preloading EGL/GLES in Zygote It's not clear this actually makes much difference on modern devices/drivers. With updatable graphics drivers, we'd have to be able to unload the preloaded driver from processes that don't use the system driver, which is additional complexity and risk. On bullhead and sailfish, meminfo actually showed slightly more memory available while sitting at launcher just after boot with this change than previously. Looking at detailed stats, the differences appeared to mostly within run-to-run variation, but there wasn't evidence of a regression. Bug: 33531483 Test: boot through lockscreen/launcher Change-Id: I1892302c1750cdbeaf5b9979f8da4dc6bd7b3e75 --- diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 8eb75c06b871..b36843759449 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -80,7 +80,6 @@ import java.security.Provider; public class ZygoteInit { private static final String TAG = "Zygote"; - private static final String PROPERTY_DISABLE_OPENGL_PRELOADING = "ro.zygote.disable_gl_preload"; private static final String PROPERTY_RUNNING_IN_CONTAINER = "ro.boot.container"; private static final int LOG_BOOT_PROGRESS_PRELOAD_START = 3020; @@ -125,9 +124,6 @@ public class ZygoteInit { bootTimingsTraceLog.traceBegin("PreloadResources"); preloadResources(); bootTimingsTraceLog.traceEnd(); // PreloadResources - bootTimingsTraceLog.traceBegin("PreloadOpenGL"); - preloadOpenGL(); - bootTimingsTraceLog.traceEnd(); // PreloadOpenGL preloadSharedLibraries(); preloadTextResources(); // Ask the WebViewFactory to do any initialization that must run in the zygote process, @@ -177,12 +173,6 @@ public class ZygoteInit { System.loadLibrary("jnigraphics"); } - private static void preloadOpenGL() { - if (!SystemProperties.getBoolean(PROPERTY_DISABLE_OPENGL_PRELOADING, false)) { - EGL14.eglGetDisplay(EGL14.EGL_DEFAULT_DISPLAY); - } - } - private static void preloadTextResources() { Hyphenator.init(); TextView.preloadFontCache();