Enables the use of the blastula pool.
This commit adds the code necessar to initialize and use the blastula
pool during application launching. Highlights include:
* Modifying ZygoteState to allow the creation of blastula session
sockets
* Modified application startup to track if a web view process is being
created.
* Initialization of the blastula pool during Zygote initialization.
* Blastula lifecycle management via reporting pipes and event FDs.
* Launching of applications via the blastula pool.
The creation, maintenance, and use of the blastula pool can be disabled
by setting Zygote.BLASTULA_POOL_ENABLED to false. When this feature is
disabled applications will launch as they did before this patch.
Topic: zygote-prefork
Test: make & flash & launch app & check log message
Bug: 68253328
Change-Id: I46c32ad09400591e866b6c6121d5a9b0332092f3
Merged-In: I46c32ad09400591e866b6c6121d5a9b0332092f3
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 569a894..4b994c3 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -1252,7 +1252,7 @@
fds_to_close.insert(fds_to_close.end(), blastula_pipes.begin(), blastula_pipes.end());
fds_to_ignore.insert(fds_to_ignore.end(), blastula_pipes.begin(), blastula_pipes.end());
-// fds_to_close.push_back(gBlastulaPoolSocketFD);
+ fds_to_close.push_back(gBlastulaPoolSocketFD);
if (gBlastulaPoolEventFD != -1) {
fds_to_close.push_back(gBlastulaPoolEventFD);
@@ -1277,7 +1277,7 @@
std::vector<int> fds_to_close(MakeBlastulaPipeReadFDVector()),
fds_to_ignore(fds_to_close);
-// fds_to_close.push_back(gBlastulaPoolSocketFD);
+ fds_to_close.push_back(gBlastulaPoolSocketFD);
if (gBlastulaPoolEventFD != -1) {
fds_to_close.push_back(gBlastulaPoolEventFD);