Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 204386e1 authored by Dimitry Ivanov's avatar Dimitry Ivanov Committed by Nicolas Geoffray
Browse files

zygote to preload public native libraries

Preload public native libraries when starting a zygote
This lets other users of libnativeloader (like dex2oat)
avoid unnecessary cold loads of libandroid.so which could
take up to a second.

Bug: http://b/27245894

(cherry picked from commit b0824979)

Change-Id: I04a640c104dba5b585a59d63270e81b6c9ad6f7e
parent 33e76776
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ LOCAL_SHARED_LIBRARIES := \
    libutils \
    liblog \
    libbinder \
    libnativeloader \
    libandroid_runtime \
    $(app_process_common_shared_libs) \

+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@
#include <cutils/process_name.h>
#include <cutils/properties.h>
#include <cutils/trace.h>
#include <nativeloader/native_loader.h>
#include <android_runtime/AndroidRuntime.h>
#include <private/android_filesystem_config.h>  // for AID_SYSTEM

@@ -304,6 +305,7 @@ int main(int argc, char* const argv[])
    }

    if (zygote) {
        PreloadPublicNativeLibraries();
        runtime.start("com.android.internal.os.ZygoteInit", args, zygote);
    } else if (className) {
        runtime.start("com.android.internal.os.RuntimeInit", args, zygote);