From 93f630e1c3011a36f6560fd6115cf1a0e809c5e0 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Sun, 11 Dec 2016 21:22:16 -0800 Subject: [PATCH] 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 Merged-In: I1892302c1750cdbeaf5b9979f8da4dc6bd7b3e75 --- core/java/com/android/internal/os/ZygoteInit.java | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 68299615b5b9f..7c79b40585a43 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -79,7 +79,6 @@ import java.util.ArrayList; 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 String ANDROID_SOCKET_PREFIX = "ANDROID_SOCKET_"; @@ -199,9 +198,6 @@ public class ZygoteInit { Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadResources"); preloadResources(); Trace.traceEnd(Trace.TRACE_TAG_DALVIK); - Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "PreloadOpenGL"); - preloadOpenGL(); - Trace.traceEnd(Trace.TRACE_TAG_DALVIK); preloadSharedLibraries(); preloadTextResources(); // Ask the WebViewFactory to do any initialization that must run in the zygote process, @@ -242,12 +238,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();