diff options
| author | Jesse Hall <jessehall@google.com> | 2017-01-17 10:17:41 -0800 |
|---|---|---|
| committer | Jesse Hall <jessehall@google.com> | 2017-01-17 11:13:23 -0800 |
| commit | 2852a28254a5b8b99b2a74554af1dd8e9828c60e (patch) | |
| tree | ed04f1b206bf196365b841cf59da4ffc964b5da8 /core/java | |
| parent | 1a6cd84d64cce1263958d827f8c7c90c531e5de6 (diff) | |
Revert "Stop preloading EGL/GLES in Zygote"
This reverts commit 9c9cc3e94dd3b07ebf2ab52f1837dd88a64a9b57.
Test: 5x adb shell am start -W -n com.google.android.calculator/com.android.calculator2.Calculator
Bug: 34306111
Change-Id: Iebb3c823613c97c4a2b0f1e72bcea01e4d519fc7
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/com/android/internal/os/ZygoteInit.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index b36843759449..8eb75c06b871 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -80,6 +80,7 @@ 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; @@ -124,6 +125,9 @@ 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, @@ -173,6 +177,12 @@ 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(); |
