History log of /frameworks/base/core/java/com/android/internal/os/ZygoteServer.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d0a190df8a04e10a6705148c02c5c4859ad75b70 13-Feb-2018 Robert Sesek <rsesek@google.com> Add Zygote.startChildZygote() to fork a new process that itself is a zygote.

This adds a new --start-child-zygote argument that instructs the main
zygote to create a new child process that will also be a zygote. The
system_server generates a random name in the abstract socket namespace
for it and the child-zygote to communicate over, and that is passed as
an argument to the new process.

A child-zygote bypasses the normal post-fork-child of the zygote process
in order to preserve itself as a zygote. This means not starting the
Binder threadpool nor launching into ActivityThread. Instead, a
child-zygote calls into its own main function. The main function runs a
ZygoteServer select loop, listening on the socket name specified by the
system_server when it was forked.

Unlike the system zygotes, a child-zygote can be killed without bringing
down the system. Killing a child-zygote will not terminate its child
processes, which will be reparented to init for reaping when they
eventually exit.

Bug: 63749735
Test: m (with multi-project commits landed)
Change-Id: I3e7ebbdba498f8fec1d84cdf927dc43a92be4b68
/frameworks/base/core/java/com/android/internal/os/ZygoteServer.java
ac0b4be198960ae56c3b484052bf3acccca59d22 05-Jul-2017 Narayan Kamath <narayan@google.com> Zygote: Improve logging and error handling during connections.

Before this change, we were throwing a checked exception on success
and returning on failure. This made it hard to figure out where / when
something was going wrong. This change switches things around to throw
a RuntimeException when something goes wrong and to return a Runnable
on success. This lets us make stronger assertions in both the parent
and the child process about their state and expected return values.

This change also upgrades the severity of several errors that we would
earlier just ignore. We will now reject the command and terminate the
connection to the client when we encounter these errors such as:

- Malformed arguments
- Any ZygoteSecurityException, such as thown thrown by
applyUidSecurityPolicy and applyInvokeWithSecurityPolicy.
- Any error in setting up pipes etc. to facilitate communication
with child processes.

(cherry picked from commit bf99d06003e76469a99269816babe16a22d83b89)

Bug: 13618569
Test: Manual
Merged-In: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
Change-Id: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
/frameworks/base/core/java/com/android/internal/os/ZygoteServer.java
ded209843616a98e6f97db0d1784f6d630cbd5e9 15-Aug-2016 Robert Sesek <rsesek@google.com> Create the WebViewZygote and implement WebViewZygoteInit.

This adds a new init-spawned daemon, webview_zygote, that starts a JVM and
acts as a zygote process for WebView isolated_app services.

Test: m
Test: angler boots
Test: Turn on Settings>Developer>Multiprocess Webview. webview_zygote32 or
webview_zygote64 start (requires dependent CLs).

Bug: 21643067
Change-Id: Ida98bd04b4d77736b672b03af651c4eb97ce88c1
/frameworks/base/core/java/com/android/internal/os/ZygoteServer.java
b9679dc1fad508a001e30a941148e1bdc3fe953f 19-Jan-2016 Tobias Sargeant <tobiasjs@google.com> Refactor ZygoteInit to support a WebView-specific zygote.

This is a non-functional change that separates out functionality
that should be shared between the system zygote and the WebView
zygote from that which is system zygote specific.

* Move MethodAndArgsCaller to Zygote.
* Split out server socket functions into ZygoteServer.
* Add a new (stub, for now) WebViewZygoteInit class.

Bug: 22084679
Bug: 21643067
(cherry picked from commit ba816e0c9efd8cd2aeef618a819a2ad46b742f87)

Merged-In: I4c508a42af7ab7b53d10570ad53b846df7782cc4
Change-Id: I54f04c03443d10dabe6426697d1ff8a0cc66b985
/frameworks/base/core/java/com/android/internal/os/ZygoteServer.java