diff options
| author | 2018-10-02 12:08:28 -0700 | |
|---|---|---|
| committer | 2018-10-02 15:02:36 -0700 | |
| commit | 273304166cc451d502153e7e19a1c8845d5f89df (patch) | |
| tree | 93b45ef8e2834a96a2d997e47ca74be5efd015bc | |
| parent | b32d038f04aba8e06eb14aee74757ee97180d641 (diff) | |
Close statsd log socket before zygote fork().
MetricsLogger will start to write to statsd instead of logd. Zygote uses
MetricsLogger too. So we need to close statsd socket before zygote fork() is
called (see b/30963384 for context).
Bug: 110537511
Test: Manually verified that it successfully boots with no crash with
ag/5112579 and ag/5169664 (together)
Change-Id: Id550fbd5ac2f6ca47d3293c12fb537fafa3f33a0
| -rw-r--r-- | core/jni/Android.bp | 1 | ||||
| -rw-r--r-- | core/jni/com_android_internal_os_Zygote.cpp | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/core/jni/Android.bp b/core/jni/Android.bp index 762b43079c31..c21015f92db5 100644 --- a/core/jni/Android.bp +++ b/core/jni/Android.bp @@ -232,6 +232,7 @@ cc_library_shared { "libseccomp_policy", "libgrallocusage", "libscrypt_static", + "libstatssocket", ], shared_libs: [ diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp index 364393e1c649..e2533ae6efd6 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp @@ -56,6 +56,7 @@ #include <utils/String8.h> #include <selinux/android.h> #include <seccomp_policy.h> +#include <stats_event_list.h> #include <processgroup/processgroup.h> #include "core_jni_helpers.h" @@ -853,6 +854,7 @@ static pid_t ForkCommon(JNIEnv* env, jstring java_se_name, bool is_system_server // Close any logging related FDs before we start evaluating the list of // file descriptors. __android_log_close(); + stats_log_close(); std::string error_msg; |