History log of /frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5627db89966539f9494fa119e4c86db98ebd1690 04-May-2018 Calin Juravle <calin@google.com> Make system server profiling an explicit runtime intent

Pass an explicit flag to the runtime when we need to profile the system
server. This ensures that we only start the ProfileSaver and allocate the
code cache when needed.

Test: manual, on a device with system server profiling enabled
Bug: 74081010

(cherry picked from commit 8eb891be6f53118cb4b116fe29d131de166957c1)

Merged-In: I756682a9644796afb53f0c010d2bd2764ea5a828
Change-Id: I756682a9644796afb53f0c010d2bd2764ea5a828
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3f3a08ad0d93e29703597f780ff7d1b3b4a1facb 03-May-2018 Calin Juravle <calin@google.com> Properly prepare system server profiles

Update the logic for system server profiles to work without disabling
SELinux policies.

Test: check that system_server profile is created without disabling
SElinux

Bug: 74081010
Change-Id: I8aa1e57da0f8059bcfb149fe7366d8278b4bf516
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
04194fef78ecd75ea09cb9c75c211f5170e6f91d 04-Apr-2018 Mathew Inwood <mathewi@google.com> Configurable sampling rate for hidden API access log events.

To reduce log spam, we do not log all hidden API accesses. This CL allows
configuration of the sampling rate of the log events so it can be tweaked
later if necessary.

Test: m
Test: $ adb shell settings put global hidden_api_access_log_sampling_rate 65536
Bug: 64382372
Bug: 77517571
Change-Id: I659c22bd504564da58d972f94b774a9af4039386
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
8faeab8735f1a5759b24583d55853a488639546b 16-Mar-2018 Mathew Inwood <mathewi@google.com> Configurable hidden API exemptions.

Extend the existing hidden_api_blacklist_exemptions config to support a
list of API signature prefixes to exclude from hidden API enforcement.

Push this list down to the zygote process when that process is created,
and when the list changes. This minimizes overhead, but should also ensure
that all new processes get the latest whitelist.

Test: $ adb shell settings put global hidden_api_blacklist_exemptions \
Test: Landroid/view/RemoteAnimationDefinition\\\;:Landroid/app/ActivityManager\\\$TaskDescription\\\;
Test: Manually verify logcat output from app which uses named APIs
Bug: 73337509

(cherry picked from commit 2c6f97d4c9e09a89ef3b0a96539bf6a9ab8d326c)

Merged-In: Ib1245b69da4dac50c6968f1be62f1a74591dc433
Change-Id: I7b590f272fdcfcda5f18e216788ac34bc58beaed
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6d319b8aaa961862afac48010d96d03afb11fa1c 07-Dec-2017 Jerry Zhang <zhangjerry@google.com> Write descriptors for Mtp in UsbService

The current model for setting up a functionfs
function is:

UsbDeviceManager#setCurrentFunctions() ->
intent is sent to MtpReceiver to write the descriptors ->
init/hal waits for descriptors to write, then pulls up gadget ->
Gadget is configured, a USB_STATE intent starts MtpServer

The main downside of this is a lack of reliability because
the Mtp process could be killed at any point. Normally, a
gadget is unbound if its control endpoint is closed. no_disconnect
works around this, but is still a little janky. In addition, the
extra intent delays the startup of the gadget.

With the new model, UsbDeviceManager writes the descriptors
on initialization. Since it is a system service, it won't be killed.

UsbDeviceManager#setCurrentFunctions() ->
init/hal pulls up gadget ->
Gadget is configured, a USB_STATE intent starts MtpServer
MtpServer calls UsbManager#getControlFd to get a dup of the control
endpoint.

Also modify permissions so system server can access mtp files.

Bug: 72877174
Test: Change usb configurations to ptp/mtp
Change-Id: Id17d2b5930f4e1f37ec1b4f00add9d594174ad49
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
27e4b74a3d88b5ece9c904c7759d454765e4c372 17-Feb-2018 Jeff Sharkey <jsharkey@android.com> Define sane default target SDK for system_server.

Normal app launches always define a target SDK, but system_server
doesn't pass in an "--target-sdk-version" option, meaning we left
the default value target SDK of "0" in place, which isn't a valid
SDK level, meaning we treat it as targeting Android 1.0.

The majority of target SDK checks are using the higher-level value
provided from Context, meaning they've always been enforced; this
change means that we're now applying lower-level target SDK checks
that go through VMRuntime.

Test: builds, boots, typical operations still work
Bug: 72331067
Change-Id: I6940bb8c3a1cd2234bcacadbf60c902625876a76
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c0276a54ec20d83d0aa662c610ff5d24bc75fd33 17-Feb-2018 Robert Sesek <rsesek@google.com> Merge "Add Zygote.startChildZygote() to fork a new process that itself is a zygote." am: 554cfd1f1d am: 5b9410c74b
am: 4523bf284a

Change-Id: Ib714e447f06323d38c98de683f5547e66749856e
554cfd1f1de5a778a7dca547f3fbf6a350094f14 17-Feb-2018 Treehugger Robot <treehugger-gerrit@google.com> Merge "Add Zygote.startChildZygote() to fork a new process that itself is a zygote."
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/ZygoteInit.java
b981617ec752df09e253e760244dd739c4d4cb26 12-Feb-2018 Calin Juravle <calin@google.com> Pass the compilation reason to dexopt

Record the compilation reason in the oat files to enable better
performance monitoring.

Test: DexoptOptionsTest
manual
Bug: 73102540

Change-Id: Ifa487d4bc33dcd06f12af6bdd1d9a9c5f4562f4b
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4bc8f4daf3635b50e25a470c2e07e4d62b5e798f 12-Feb-2018 Calin Juravle <calin@google.com> Pass the compilation reason to dexopt

Record the compilation reason in the oat files to enable better
performance monitoring.

Test: DexoptOptionsTest
manual
Bug: 73102540

Change-Id: Ifa487d4bc33dcd06f12af6bdd1d9a9c5f4562f4b
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
29c772cb4835794e02084043be7ca139c1fb2171 01-Feb-2018 Calin Juravle <calin@google.com> [framework] Pass .dm files to dexopt at install time

(cherry picked from commit cc65194e8e5a284e915176200a846ec75c037d95)

Test: DexoptOptionsTest
adb install foo.apk foo.dm
Bug: 30934496

Merged-In: If7e705a0efc0954a385ec3bfe7a93921c0d83351
Change-Id: If7e705a0efc0954a385ec3bfe7a93921c0d83351
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ea6c0ffb4a276210b6d971c87a15a7484446d3df 20-Jan-2018 Calin Juravle <calin@google.com> [framework] Extend profile operations to take the profile name

Extend the installd profile interface to take the profile name as
argument. This shifts the responsibility for choosing the names of
profiles for primary apks completely to PackageManager. Each of the
application code paths will get an unique profile name based on their
split name.

All the profile operations will now work on a specific profile name rather
than assuming a default global name.

Also, move dumpProfiles and clearProfiles functionality to the
ArtManagerService so that we can re-use profileName computations easier.

(cherry picked from commit 6ae39fc2e5b4692d092a042816939fd0a5f3e3b8)

Test: manual (dexopt apps, merge profiles, clear profiles)
gts GtsAndroidRuntimeManagerHostTestCases
Bug: 30934496

Merged-In: Ie65d45eed7de0844edf4b7af918d7eaa74ec1f2c
Change-Id: Ie65d45eed7de0844edf4b7af918d7eaa74ec1f2c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
b3a4aab310098146e803c5abdc1886f44cb5bee3 13-Feb-2018 David Brazdil <dbrazdil@google.com> Refactor runtime hidden API flag from negative to positive

There are only two situations in which we want to enable hidden API
access flag checks. Turning the flag from DISABLE_ to ENABLE_
simplifies logic in ART and reduces the number places where the flag
had to be passed down to ART.

Bug: 64382372
Test: boot device, install and run apps, check log messages

(cherry picked from commit f7e31c0a2b69e97662e2bdeb7e5b5c6d0a7f995c)

Change-Id: Ib2f70696d98c6e1500d1d419d6acf0a8d0487213
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f7e31c0a2b69e97662e2bdeb7e5b5c6d0a7f995c 13-Feb-2018 David Brazdil <dbrazdil@google.com> Refactor runtime hidden API flag from negative to positive

There are only two situations in which we want to enable hidden API
access flag checks. Turning the flag from DISABLE_ to ENABLE_
simplifies logic in ART and reduces the number places where the flag
had to be passed down to ART.

Bug: 64382372
Test: boot device, install and run apps, check log messages
Change-Id: Ic5a531834360b614fc93d54221c7395579791184
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
cc65194e8e5a284e915176200a846ec75c037d95 01-Feb-2018 Calin Juravle <calin@google.com> [framework] Pass .dm files to dexopt at install time

Test: DexoptOptionsTest
adb install foo.apk foo.dm
Bug: 30934496

Change-Id: If7e705a0efc0954a385ec3bfe7a93921c0d83351
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6ae39fc2e5b4692d092a042816939fd0a5f3e3b8 20-Jan-2018 Calin Juravle <calin@google.com> [framework] Extend profile operations to take the profile name

Extend the installd profile interface to take the profile name as
argument. This shifts the responsibility for choosing the names of
profiles for primary apks completely to PackageManager. Each of the
application code paths will get an unique profile name based on their
split name.

All the profile operations will now work on a specific profile name rather
than assuming a default global name.

Also, move dumpProfiles and clearProfiles functionality to the
ArtManagerService so that we can re-use profileName computations easier.

Test: manual (dexopt apps, merge profiles, clear profiles)
gts GtsAndroidRuntimeManagerHostTestCases
Bug: 30934496

Change-Id: Ie65d45eed7de0844edf4b7af918d7eaa74ec1f2c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
7c48e0e074c62eccf0fb6fdad8fd03b4b6107c23 18-Jan-2018 David Brazdil <dbrazdil@google.com> Set DEXOPT_DISABLE_HIDDEN_API_CHECKS for system apps

For now, system apps will be exempt from hidden API access checks.
Pass the appropriate flag to dexopt.

Test: manual
Bug: 64382372
Bug: 72305689
Merged-In: I5676ffa3a5ba680bf5f6bab0b62f0acf4a933097
Change-Id: Idc3067d2c6040f15fe0f051090ba45efe591ebae
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
464ed3d55f18b256ea1db78c9d46b08b54a96ce8 18-Jan-2018 David Brazdil <dbrazdil@google.com> Set DEXOPT_DISABLE_HIDDEN_API_CHECKS for system apps

For now, system apps will be exempt from hidden API access checks.
Pass the appropriate flag to dexopt.

Test: manual
Bug: 64382372
Bug: 72305689
Change-Id: I5676ffa3a5ba680bf5f6bab0b62f0acf4a933097
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
217682248b25b375891bb55ca058a09b57c3417c 18-Jan-2018 Victor Hsieh <victorhsieh@google.com> Merge "Reland: Move zygote's seccomp setup to post-fork" am: 7839672e22 am: 4249466562
am: dec688691d

Change-Id: Ibcf5eeef74b69112f568ebb1f146c2990ffed30a
c8176efe2e2dc3aadc69c32b6aa9180751778e8f 08-Jan-2018 Victor Hsieh <victorhsieh@google.com> Reland: Move zygote's seccomp setup to post-fork

Before this change, seccomp filter setup is as early as in zygote's main
function. To make it possible to split app and system server's filter,
this postpone the setup to after fork. It also starts to call app
specific and system server specific setup function.

The filter setup is done in Zygote's ForkAndSpecializeCommon. This is
because adding a seccomp filter must be done when either the caller has
CAP_SYS_ADMIN or after the PR_SET_NO_NEW_PRIVS bit is set. Given that
setting PR_SET_NO_NEW_PRIVS breaks SELinux domain transition
(b/71859146), this must be done after Zygote forks but before
CAP_SYS_ADMIN is droppped.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Test: no selinux denial flood in dmesg with selinux enforced
Test: debuggerd -b `pidof com.android.phone` # logcat shows tombstoned
received crash request
Bug: 63944145
Bug: 71859146

Change-Id: I8215c8530d3d0de504a270488f8e29635805e8b0
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f24977b523c17f276a236be6fea784f8d4ee32db 17-Jan-2018 David Brazdil <dbrazdil@google.com> Merge "Pass targetSdkVersion to installd" am: 106a915256 am: 77ba6baab5
am: 4bf5b7c59e

Change-Id: I919eb49c4610477565cd85912e88ec135317a0b3
3d44ed0dfe33da3b9f08d102723d7fc842e18f74 16-Jan-2018 David Brazdil <dbrazdil@google.com> Pass targetSdkVersion to installd

Dex2oat now accepts targetSdkVersion as a parameter to determine
whether ART should treat the app as "legacy" and allow or restrict
access to private APIs.

We also bump arguments of otapreopt to v4 to accommodate the new value.

Bug: 64382372
Test: manual
Change-Id: Iae3867325dfaf8deaba51626ab04b97ad797d3b6
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
fe6a51fcb5591dc39636ce5c29536d05810dd3f5 10-Jan-2018 Victor Hsieh <victorhsieh@google.com> Revert "Move zygote's seccomp setup to post-fork"

This reverts commit 6a4a3398325787f6cb1b93db17a7bf50d353e2a5.

Reason for revert: caused some SELinux error

Bug: 71768585
Change-Id: I0ef270ec6fed1d5d96b4257ec1a2dd6a55a816ed
Merged-In: Ic1b81e146b52b68445ba634de39657f199107da3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
df449ee9c31e12d8c1960051de9c4aebcb8bb8c5 10-Jan-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Move zygote's seccomp setup to post-fork""
551e5af0d476724f192f896e651d078aea6bf61a 10-Jan-2018 Victor Hsieh <victorhsieh@google.com> Revert "Move zygote's seccomp setup to post-fork"

This reverts commit a188dbc050b9fca41ed92928d68ed00c562de580.

Reason for revert: selinux denials, see b/71768585

Change-Id: Ic1b81e146b52b68445ba634de39657f199107da3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6a4a3398325787f6cb1b93db17a7bf50d353e2a5 20-Dec-2017 Victor Hsieh <victorhsieh@google.com> Move zygote's seccomp setup to post-fork

Before this change, seccomp filter setup is as early as in zygote's main
function. To make it possible to split app and system server's filter,
this postpone the setup to after fork. It also starts to call app
specific and system server specific setup function.

In terms of performance since this happens at fork, the measure shows
the overhead is negligible. Assuming 130 instruction in the BPF, on
walleye, even when running on little core with fixed low frequency, each
setup took about 60.9us on average. When it runs on big core with
higher frequency, it took about 39.3us.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Bug: 63944145

Change-Id: I748735b478405098beac1e200d911c13ea60e380
Merged-In: I748735b478405098beac1e200d911c13ea60e380
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
df86ddb3f9612444e1f08d751845f835958beb9c 09-Jan-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Move zygote's seccomp setup to post-fork"
a188dbc050b9fca41ed92928d68ed00c562de580 08-Jan-2018 Victor Hsieh <victorhsieh@google.com> Move zygote's seccomp setup to post-fork

Before this change, seccomp filter setup is as early as in zygote's main
function. To make it possible to split app and system server's filter,
this postpone the setup to after fork. It also starts to call app
specific and system server specific setup function.

Test: (cts) -m CtsSecurityTestCases -t android.security.cts.SeccompTest
Bug: 63944145

Change-Id: I748735b478405098beac1e200d911c13ea60e380
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4a539441d844f85fd899862078b4c27641c1b606 06-Jan-2018 Jeff Sharkey <jsharkey@android.com> Start using new reserved disk GID.

We recently created a new GID that can be granted to critical system
processes, so that the system is usable enough for the user to free
up disk space used by abusive apps.

Define a permission for the GID so we can grant it to system apps,
and add the GID to core apps needed for system stability. (The list
was mostly derived from filling a disk and seeing what caused the
device to fall over.)

Test: builds, boots
Bug: 62024591
Change-Id: Icdf471ed3bed4eeb8c01f1d39f0b40c1ea098396
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
220871a697290529278ed16db508eda8e12f3fc7 14-Nov-2017 Xin Li <delphij@google.com> Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
7ba73dd509c39a073bc59901df78b24632c77fd7 12-Sep-2017 Calin Juravle <calin@google.com> [framework] Add check that classpath is up to date to getDexOptNeeded

(cherry picked from commit 576e6c0cbb0231d6650dee70319d7443c601fa1b)

Bug: 62269291
Test: manual, install new apk/splits and force updates.
I used com.android.cts.classloadersplitapp as the test app.
1) install-multiple split apks with dependency: Base -> A -> B
2) push an update for A
3) adb shell cmd package compile
4) check that A & B got recompiled and that B was because a class loader
context mismatch (e.g. "ClassLoaderContext classpath element checksum
mismatch for position 1.").

Merged-In: I4092562966413dc8976c9d41b26a90bbb9e37e1e
Change-Id: I4092562966413dc8976c9d41b26a90bbb9e37e1e
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3aeca17aa911394e7a4d2c1536b28423cb135b53 25-May-2017 Shubham Ajmera <shubhamajmera@google.com> Reduce app size by downgrading inactive apps

This will trigger when the device will have low space.
Active apps here refer to the apps which were either active
in foregrond or in background and also used by other packages.
Apps which are inactive for X days downgraded to verify. X is
determined by sysprop pm.dexopt.unopt_after_inactive_days

If the system properties are not set, no effect will take place.

The above operations will take place in background dexopt service.
If user uses the app again, it will again be speed-compiled when
background dexopt service starts next time.

(cherry picked from commit 246dccf9327631597767afe418ce43ae6d07d102)

Bug: 36598475
Test: manual
* Remove the check in the code that allows downgrade only when
the space is low on the device.
* adb root
* Set pm.dexopt_unopt_after_inactive_days to 600
* Make sure the current time of the device is correctly set
* Install 2 non system apps - B, C
* Downgrade B to extract
* Upgrade a system apps to speed-profile - E
* Downgrade a system app to quicken - G
* adb shell cmd package bg-dexopt-job

Expected Results:
* Extract - B
* Verify - C
* There should not be any entries for apps E an G
in dalvik_cache

Merged-In: I68f9f617d6722a7ba8b00aa2181cb38a165cfc51
Change-Id: I68f9f617d6722a7ba8b00aa2181cb38a165cfc51
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c477ab141f9171f329c96b97ee073354847f727c 16-Jun-2017 Mathieu Chartier <mathieuc@google.com> Add property for system server compiler filter

The property is dalvik.vm.systemservercompilerfilter, this changes
if dexopt is needed.

(cherry picked from commit 5e07a0d9cacb1bf943f4617b1edcb930e1578dad)

Bug: 62356545
Test: adb shell setprop dalvik.vm.systemservercompilerfilter quicken
Test: adb shell stop && adb shell start

Merged-In: I2ef3737f24816a4cb75e718abf274a891eb9fda1
Change-Id: I2ef3737f24816a4cb75e718abf274a891eb9fda1
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
576e6c0cbb0231d6650dee70319d7443c601fa1b 12-Sep-2017 Calin Juravle <calin@google.com> [framework] Add check that classpath is up to date to getDexOptNeeded

Bug: 62269291
Test: manual, install new apk/splits and force updates.
I used com.android.cts.classloadersplitapp as the test app.
1) install-multiple split apks with dependency: Base -> A -> B
2) push an update for A
3) adb shell cmd package compile
4) check that A & B got recompiled and that B was because a class loader
context mismatch (e.g. "ClassLoaderContext classpath element checksum
mismatch for position 1.").

Change-Id: I4092562966413dc8976c9d41b26a90bbb9e37e1e
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
66d7275d393209bea48711df633b023d987652bb 15-Sep-2017 Narayan Kamath <narayan@google.com> Merge changes Id931d441,I83faf974
am: 89c94f67b4

Change-Id: Ifc090e141092bcee11704e45d6f97f642040d002
8f4eab2fccbc333604f1d248dac9a736db96bc6b 14-Sep-2017 Andreas Gampe <agampe@google.com> resolve merge conflicts of eb8a4ef5d344 to oc-mr1-dev-plus-aosp

Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ia29e31d704982985264b40a78578a4c93d11bf3a
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/ZygoteInit.java
8dbb5e51c8419eeec8b6fcddb101fcdf40ca9f03 13-Sep-2017 Nicolas Geoffray <ngeoffray@google.com> resolve merge conflicts of e017dae5873c to stage-aosp-master

Test: I solemnly swear I tested this conflict resolution.
Change-Id: I7008986501028ec9bee0505d41aae3ff27872b50
81edac40374b1d3203f7adac32e299147db7eba2 07-Sep-2017 Nicolas Geoffray <ngeoffray@google.com> Rename debugFlags to runtimeFlags.

Also now pass the flags to the forked process through --runtime-flags instead
of converting to command line arguments and converting back to an integer.

bug: 30972906
bug: 63920015

Test: builds

Change-Id: I7f10c43dd916ca2d3b9b5141f17261eb7b64f49a
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
22f95dbdc04e693b87aba76ff9b5854ea7c5a2c0 17-Aug-2017 Luis Hector Chavez <lhchavez@google.com> Merge "Improve container capability bounding in containers" am: 586fd52b34 am: ed05287c55 am: 755baf92b4
am: 64f1d42e6c

Change-Id: I785676decb2fc7ddfa9034fbafdfc2deb2f07604
64f1d42e6ca553d8275001c2d7a02b41403bd773 17-Aug-2017 Luis Hector Chavez <lhchavez@google.com> Merge "Improve container capability bounding in containers" am: 586fd52b34 am: ed05287c55
am: 755baf92b4

Change-Id: I07eb375c2b86651fd7d65f944b19161d2c977df4
ed05287c552a5a2f37f1518b425d2ae33203325b 16-Aug-2017 Luis Hector Chavez <lhchavez@google.com> Merge "Improve container capability bounding in containers"
am: 586fd52b34

Change-Id: I7c67b571164e67b3e4a8ae9c9a2701e338693a4b
586fd52b3411edb97fa1a468103d7cb2b38d6be9 16-Aug-2017 Treehugger Robot <treehugger-gerrit@google.com> Merge "Improve container capability bounding in containers"
72042c99a65b91fb701f1b13a0ba4b225769eece 12-Jul-2017 Luis Hector Chavez <lhchavez@google.com> Improve container capability bounding in containers

This change stops relying on the ro.boot.container property for dropping
a subset of capabilities and instead relies on the effective capability
mask of the Zygote process, prior to forking.

When Android is running in a pid/mount/net/user namespace, even if a
particular capability is present, some operations that require that
capability check whether it is allowed in the init namespace (instead of
in the current namespace), so they would fail even with the capability
granted within the namespace. So, explicitly dropping the capabilities
from the beginning allows for clearer signalling of which operations can
be expected to work instead of failing silently for mysterious reasons.

Bug: 63579953
Test: aosp_bullhead-eng still boots
Test: Running Zygote without CAP_SYS_MODULE makes it such that
system_server does not request it.

Change-Id: I1d18d13341bcc04e701fd14092e7e94961728620
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6e3461b67cae27a42a4d77fa277ba2d844ea0cde 11-Aug-2017 Fyodor Kupolov <fkupolov@google.com> Log timings for shutdown stages

Renamed BootTimingsTraceLog to TimingsTraceLog. It is now used for
boot and shutdown logging.

Added measurements for main stages of shutdown in the system server:
ShutdownTiming: SendShutdownBroadcast took to complete: 734ms
ShutdownTiming: ShutdownActivityManager took to complete: 203ms
ShutdownTiming: ShutdownPackageManager took to complete: 17ms
ShutdownTiming: ShutdownBt took to complete: 533ms
ShutdownTiming: ShutdownRadio took to complete: 534ms
ShutdownTiming: ShutdownNfc took to complete: 1536ms
ShutdownTiming: ShutdownRadios took to complete: 1538ms
ShutdownTiming: ShutdownStorageManager took to complete: 906ms
ShutdownTiming: SystemServerShutdown took to complete: 3918ms

Bug: 64569080
Test: shutdown/reboot and check logs
Change-Id: I636c045852cd1ed6be1c58af6608f70e95756389
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
2f09ff38f6f869809dbab6a15ea3db8add849703 25-Jul-2017 Calin Juravle <calin@google.com> Fix system server compilation in ZygoteInit

The code which dexopt SystemServer in ZygoteInit used to pass the
sharedLibrary string in the old format.

This CL updates the classPath string to the new class loader context
encoding.

Bug: 63941300
Test: compile WITH_DEXPREOPT=false and WITH_DEXPREOPT_BOOT_IMG_ONLY=false
and check that when the device boots the correct context is passed to
dex2oat.

(cherry picked from commit b0dede3ec2e57a734fe17bef4920020c2d66488c)

Change-Id: Ie27cd21b0b9c8b7e226bce74dfa297569ac12317
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0abf6a84853027ec8e26c1c07777b10fa05b3988 25-Jul-2017 Shubham Ajmera <shubhamajmera@google.com> Update DexFile#getDexOptNeeded usages to reflect API change am: 52c8620c19
am: 51b9a824d5

Change-Id: I40cb970c53220f42558cb8b968efc97b8c7408d6
52c8620c1945de45f22c1e62dcb69ddadca07675 25-Jul-2017 Shubham Ajmera <shubhamajmera@google.com> Update DexFile#getDexOptNeeded usages to reflect API change

Test: make and boot
Merged-in: I68f9f617d6722a7ba8b00aa2181cb38a165cfc51
Bug: 36598475
(partially cherry-picked from commit 246dccf9327631597767afe418ce43ae6d07d102)

Change-Id: Idfc9276eb2b61244bbd634f49a3912dab6fcabfa
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
d4185538dc8a7d7fb3f27b50fa736cdb4f2e3c9e 19-Jul-2017 Shubham Ajmera <shubhamajmera@google.com> Update DexFile#getDexOptNeeded usages to reflect API change

Test: make and boot
Merged-in: I68f9f617d6722a7ba8b00aa2181cb38a165cfc51
Bug: 36598475
(partially cherry-picked from commit 246dccf9327631597767afe418ce43ae6d07d102)

Change-Id: If90690d6234dc8727df2b2fb485f0c8d50970a92
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
246dccf9327631597767afe418ce43ae6d07d102 25-May-2017 Shubham Ajmera <shubhamajmera@google.com> Reduce app size by downgrading inactive apps

This will trigger when the device will have low space.
Active apps here refer to the apps which were either active
in foregrond or in background and also used by other packages.
Apps which are inactive for X days downgraded to verify. X is
determined by sysprop pm.dexopt.unopt_after_inactive_days

If the system properties are not set, no effect will take place.

The above operations will take place in background dexopt service.
If user uses the app again, it will again be speed-compiled when
background dexopt service starts next time.

Bug: 36598475
Test: manual
* Remove the check in the code that allows downgrade only when
the space is low on the device.
* adb root
* Set pm.dexopt_unopt_after_inactive_days to 600
* Make sure the current time of the device is correctly set
* Install 2 non system apps - B, C
* Downgrade B to extract
* Upgrade a system apps to speed-profile - E
* Downgrade a system app to quicken - G
* adb shell cmd package bg-dexopt-job

Expected Results:
* Extract - B
* Verify - C
* There should not be any entries for apps E an G
in dalvik_cache

Change-Id: I68f9f617d6722a7ba8b00aa2181cb38a165cfc51
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ceddb7508d75c162c091f8788c18b94e2f661e7e 14-Jul-2017 Jesse Hall <jessehall@google.com> Merge "Preload app-process HALs in Zygote" into oc-dr1-dev
am: 61d1af5746

Change-Id: I2b51bd19d1fde7fc8e0e1cc9de71a3cd5d1a7ef9
42cf26ecc9942443e046e9a62347d10b9e2b50d5 07-Jul-2017 Jesse Hall <jessehall@google.com> Preload app-process HALs in Zygote

Some HALs, like a.h.graphics.mapper, are always passthrough and are
used by nearly all app processes. Preload those in Zygote to save app
startup time and share more pages between processes. This has the side
effect of also preloading a bunch of HIDL-related system and vndk
libraries that would also otherwise be loaded independently by every
app.

An earlier attempt at this change tried to preload the HAL via a
static initializer in libui.so (which is already preloaded, and which
is the immediate client of the HAL). But several other non-Zygote
processes also use libui.so, and didn't have SELinux permission to
access the device nodes used by the HAL. This version uses an explicit
call from Zygote to preload the HAL, instead of doing it implicitly.

Bug: 62353585
Test: check that a.h.graphics.mapper is in /proc/`pid zygote64`/maps
Change-Id: I42405c3b6cdf1ae412039140d656d15a6d4f8882
(cherry picked from commit 1fe1dc0131f8251703ad54ac5e79eefa84affc2b)
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
7861989f6604b1b689573e87206c65bda26ae134 12-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Preload app-process HALs in Zygote"
b2f9ab33478f4daf77bd57d4e90bcb819aa671ed 10-Jul-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow splits to declare a classloader type."
1fe1dc0131f8251703ad54ac5e79eefa84affc2b 07-Jul-2017 Jesse Hall <jessehall@google.com> Preload app-process HALs in Zygote

Some HALs, like a.h.graphics.mapper, are always passthrough and are
used by nearly all app processes. Preload those in Zygote to save app
startup time and share more pages between processes. This has the side
effect of also preloading a bunch of HIDL-related system and vndk
libraries that would also otherwise be loaded independently by every
app.

An earlier attempt at this change tried to preload the HAL via a
static initializer in libui.so (which is already preloaded, and which
is the immediate client of the HAL). But several other non-Zygote
processes also use libui.so, and didn't have SELinux permission to
access the device nodes used by the HAL. This version uses an explicit
call from Zygote to preload the HAL, instead of doing it implicitly.

Bug: 62353585
Test: check that a.h.graphics.mapper is in /proc/`pid zygote64`/maps
Change-Id: I42405c3b6cdf1ae412039140d656d15a6d4f8882
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
bf99d06003e76469a99269816babe16a22d83b89 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.

Bug: 13618569
Test: Manual
Change-Id: Id931d44135ae2e4ede1bbac6a4b187f6c139e1fd
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f9419f0f8524da4980726e06130a80e0fb226763 15-Jun-2017 Narayan Kamath <narayan@google.com> Allow splits to declare a classloader type.

Add an attribute android:classLoader which can be set to the name
of the classloader the base or split wishes to use. For now, this can
only be set to "dalvik.system.PathClassLoader" or
"dalvik.system.DelegateLastClassLoader". The current implementation
only allows the classloader to exist in the boot classpath but that
restriction can be loosened in a future change if necessary.

Test: cts-tradefed run cts-dev -m CtsAppSecurityHostTestCases
Bug: 36044779

Change-Id: I5a51f7aa0c8c4c398d2f46129eb06785cc8e3c3f
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
5e07a0d9cacb1bf943f4617b1edcb930e1578dad 16-Jun-2017 Mathieu Chartier <mathieuc@google.com> Add property for system server compiler filter

The property is dalvik.vm.systemservercompilerfilter, this changes
if dexopt is needed.

Bug: 62356545
Test: adb shell setprop dalvik.vm.systemservercompilerfilter quicken
Test: adb shell stop && adb shell start

Change-Id: I2ef3737f24816a4cb75e718abf274a891eb9fda1
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
9cf8c281d2c66b78f6f3fd8bd54d327cc3a211c9 08-Jun-2017 Jesse Hall <jessehall@google.com> Merge "Allow disabling GL preload even if gfxdriver isn't updatable"
f037caed376f526b0e1106088a6a9f8b1a402847 08-Jun-2017 Andreas Gampe <agampe@google.com> Merge "Framework: Remove SamplingProfiler" into oc-dev-plus-aosp
am: 837f1167ca

Change-Id: I2a510538bace272330e1d4446adf2451f3bb4c07
dc7f65ac64af0a8f1d1b63a7772fc7c8ad56e2c2 02-Jun-2017 Andreas Gampe <agampe@google.com> Framework: Remove SamplingProfiler

Remove the very old and unsupported SamplingProfilerIntegration. This
CL removes the code parts.

(cherry picked from commit d52cad2cc9af5eb54b28b69fa5b8242258e590ae)

Bug: 37272346
Test: m
Test: Device boots
Change-Id: I64d77244b5816ef1f605d19530b96be38f5c1bc6
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
5085ef71e9e6b0bd63f9ff0b80876049193885b5 02-Jun-2017 Andreas Gampe <agampe@google.com> Framework: Remove SamplingProfiler

Remove the very old and unsupported SamplingProfilerIntegration. This
CL removes the code parts.

Bug: 37272346
Test: m
Test: Device boots
Merged-In: I64d77244b5816ef1f605d19530b96be38f5c1bc6
Change-Id: I64d77244b5816ef1f605d19530b96be38f5c1bc6
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f20fdb93205fefd80364383812fe645307d08462 14-Apr-2017 Jesse Hall <jessehall@google.com> Allow disabling GL preload even if gfxdriver isn't updatable

Bug: 34611670
Test: set ro.zygote.disable_gl_preload=1, shell start,
confirm GL driver isn't loaded in zygote process
by checking /proc/<pid>/maps

Change-Id: Ieb739bd7eba365917684cf830d78c15fea06f8cf
(cherry picked from commit 5d911fe6bb8f05a69b208fafeb3f6bd4b13f06ad)
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
d52cad2cc9af5eb54b28b69fa5b8242258e590ae 02-Jun-2017 Andreas Gampe <agampe@google.com> Framework: Remove SamplingProfiler

Remove the very old and unsupported SamplingProfilerIntegration. This
CL removes the code parts.

Bug: 37272346
Test: m
Test: Device boots
Change-Id: I64d77244b5816ef1f605d19530b96be38f5c1bc6
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
62cc11996d0d74a382f97f8135282d2f59d7b9d1 13-May-2017 John Reck <jreck@google.com> Flag apps that have debugging set in systrace

Fixes: 36885723
Test: manual, ran systrace, verified only the app in #1
has the warning line and other (non-debuggable) apps
do not.

Change-Id: I244d28aeab352b524df4f1673654fdeb277d9f9c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f0c52b5e9c498c31a963232a008ca43836ebc32a 27-Apr-2017 Gustav Sennton <gsennton@google.com> Add a time-out for connecting to SystemServer, and WebView, zygotes.

We wait for both the system server and the WebView zygotes, using
infinite loops.
This CL adds a time-out to both these loops.

Bug: 37654329
Test: Boot device, disable Chrome, enable Chrome, then start a WebView
app.

Change-Id: I74397de3caf2b02ee403195aeb3beb2320a2240d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
8cafe5d9b442d5177d6f5110695821318ca79cf9 14-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Allow disabling GL preload even if gfxdriver isn't updatable" into oc-dev
5d911fe6bb8f05a69b208fafeb3f6bd4b13f06ad 14-Apr-2017 Jesse Hall <jessehall@google.com> Allow disabling GL preload even if gfxdriver isn't updatable

Bug: 34611670
Test: set ro.zygote.disable_gl_preload=1, shell start,
confirm GL driver isn't loaded in zygote process
by checking /proc/<pid>/maps

Change-Id: Ieb739bd7eba365917684cf830d78c15fea06f8cf
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4567c1a1a3af78c890dfbb8bae91e2f15a684516 08-Apr-2017 Mathieu Chartier <mathieuc@google.com> Merge "Enable profiling for system server for userdebug|eng" into oc-dev
b3eecebddd08f43790f3104bbb298f480b2338dd 31-Mar-2017 Mathieu Chartier <mathieuc@google.com> Enable profiling for system server for userdebug|eng

Only for these two configurations since selinux permissions only
allow system_server to access profiles in these cases.

Motivation is to allow collecting profiles for improving RAM and
performance for preopt.

Setting the property dalvik.vm.profilesystemserver to true is required
to enable the collection of profiles for system server.

Test: device boots

Bug: 34927277
Bug: 36457259

Change-Id: Icbba6dafe376fd9c6c3d0c7feba7f64009f7c2c3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
811a75a0c0dbe211ccabdfbfba60c8f76d5738eb 06-Apr-2017 Calin Juravle <calin@google.com> Pass SElinux info to installd dexopt

For secondary dex files, the oat directory is created on the fly. We
need to make sure we restore the SElinux context after the oat files are
generated. To do that we need to pass the app SElinux info to installd
dexopt.

Bug: 36896515
Test: adb shell cmd package compile -r bg-dexopt --secondary-dex com.google.android.gms
adb shell ls
/data/user_de/0/com.google.android.gms/app_chimera/m/0000000c/oat/arm64/
-Z
youtube loads gms modules without extracting from apk

Change-Id: I5be34b42a509701f6222ca52bec4761c161ec6eb
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
180f5e918c099a87fe80b4e18730ac7b45e18534 16-Mar-2017 tony.ys_liu <tony.ys_liu@htc.com> Merge "Set system server's class loader for wrap.system_server" am: 8d2d6bfa12 am: 959628a32e
am: d794855fba

Change-Id: Id7f48fe3c4b1855e8e9a450c70db00f057502ad4
959628a32ed0c5d3e9c69df1184f54f8919ea56b 16-Mar-2017 tony.ys_liu <tony.ys_liu@htc.com> Merge "Set system server's class loader for wrap.system_server"
am: 8d2d6bfa12

Change-Id: Iba4af152c9f29ad6e8c9bb1b0a1047e96d287c6b
34738174ba6e5967b51cb4fd77de49d5717d225d 14-Dec-2016 tony.ys_liu <tony.ys_liu@htc.com> Set system server's class loader for wrap.system_server

Root Cause: systemServer's class path is not set
after set wrap.system_server property, and restart system_server,
it shows a java.lang.RuntimeException:
Missing class when invoking static main com.android.server.SystemServer

Solution: Correctly pass and parse a passed classpath.

Bug: 34692265
Test: adb root && adb shell stop && adb shell setprop wrap.system_server logwrapper && adb shell start
Change-Id: Ia6707dc05fa627af6cc28360d26b894487a6eff1
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
35775783fc6609035136184e3843bc743b59945d 14-Mar-2017 Nick Kralevich <nnk@google.com> ZygoteInit: Remove CAP_SYS_RESOURCE

Please see commit 3082eb7c7253c62a06aa151a80487a4eabd49914 for an
explanation of this change.

This capability is not used by system_server.

Bug: 34951864
Test: code compiles, device boots, no selinux errors ever reported.
Change-Id: I4242b1abaa8679b9bfa0d31a1df565b46b7b3cc3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0fcb43ac759ebc7013819d1880393ac45c53a1cb 14-Mar-2017 Nick Kralevich <nnk@google.com> ZygoteInit: remove duplicate preloadOpenGL call

Commit ba0370eef3d17baa70d43723e96eb135c8e4ed58 added a call to
preloadOpenGL(), The nyc-mr2-dev cherrypick of that same commit
(b3a1417663d64fe003b03c97e2f24b6eeba3f9dc) was improperly handled
by the automerger and added yet another call to preloadOpenGL().
Remove the duplicate call.

Test: code compiles.
Change-Id: Ie2a1c73155197506ee9571f2c05988c77a750281
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
1e3db871e52e59c69edb1843df7f4aecb030bc6f 02-Mar-2017 Hiroshi Yamauchi <yamauchi@google.com> Fix the reset of boosted zygote thread priority.

This fixes the unexpected priority 112 of the daemon threads
(eg. HeapTaskDaemon). The problem was that when the zygote main
thread's priority is reset, it directly calls setpriority() and fails
to update the priority value in java.lang.Thread, which in turn causes
any threads created by the thread to unexpectedly inherit the boosted
priority. Calling java.lang.Thread.setPriority instead fixes.

Bug: 35801778
Bug: 28866384
Test: angler master userdebug boots and thread priorities checked.

Change-Id: I68a6ed7244a9067acc2749feca7f88422bf44b02
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3082eb7c7253c62a06aa151a80487a4eabd49914 16-Feb-2017 Nick Kralevich <nnk@google.com> system_server: add CAP_SYS_PTRACE

Commit https://android.googlesource.com/kernel/common/+/f0ce0eee added
CAP_SYS_RESOURCE as a capability check which would allow access to
sensitive /proc/PID files. system_server uses this capability to collect
smaps from managed processes. Presumably this was done to avoid the
implications of granting CAP_SYS_PTRACE to system_server.

However, with SELinux enforcement, we can grant CAP_SYS_PTRACE but not
allow ptrace attach() to other processes. The net result of this is that
CAP_SYS_PTRACE and CAP_SYS_RESOURCE have identical security controls, as
long as system_server:process ptrace is never granted.

Add CAP_SYS_PTRACE to the set of capabilities granted to system_server.

Don't delete CAP_SYS_RESOURCE for now. SELinux has blocked the use of
CAP_SYS_RESOURCE, but we still want to generate audit logs if it's
triggered. CAP_SYS_RESOURCE can be deleted in a future commit.

Bug: 34951864
Test: Device boots, functionality remains identical, no sys_resource
denials from system_server.

Change-Id: I2570266165396dba2b600eac7c42c94800d9c65b
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
669afcc9d05606eeaf7ebe87f991e1bf1b583f9d 06-Feb-2017 Narayan Kamath <narayan@google.com> Zygote: Add support for explicit preloading of resources.

Add a --preload-default command that instructs the zygote to preload
resources. The command is a no-op if resources have already been
preloaded.

Test: manual.
Change-Id: I4a846a7d911fa929af472d9071ffbff6df424176
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
b49996d8e2658ea2d62cd19d28edd70b2b22f605 06-Feb-2017 Narayan Kamath <narayan@google.com> Zygote: Reset niceness if lazy preloading is enabled.

By definition, the zygote in question is lower priority if lazy
preloading is enabled. We therefore reset the zygote process'
niceness to 0 as soon as it comes up, rather than having it stick
around as a higher priority process until we eventually ask it
to load the default set of resources.

Test: manual.

Change-Id: I3ccfc0e7c3fdebf5f798d90b53140a554bf64c20
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
01f47c116c46613e7158c8b40d0bee39f5ca96cf 11-Feb-2017 Jesse Hall <jessehall@google.com> resolve merge conflicts of b3a1417663d6 to nyc-mr2-dev-plus-aosp
am: 516274249f

Change-Id: Ifd131fb69d3fb2fe31bd0f06c074fdf15408dece
516274249fa2f94c36e93eef650220ad67b75d2f 11-Feb-2017 Jesse Hall <jessehall@google.com> resolve merge conflicts of b3a1417663d6 to nyc-mr2-dev-plus-aosp

Test: mmma frameworks/base
Change-Id: I2e1e04f55d05fd8aa33da304bdb951713b37793c
b3a1417663d64fe003b03c97e2f24b6eeba3f9dc 09-Feb-2017 Jesse Hall <jessehall@google.com> Zygote: Restore GL preload

Preloading GLES drivers in Zygote was removed previously since it is
incompatible with updatable drivers. That caused some app startup
latency and system memory use regressions. This change re-adds GLES
driver preloading, but only on devices that don't support driver
updates.

Bug: 34611670
Bug: 35052548
Test: boot angler, systrace of Calculator app startup
Change-Id: Ibdc6b3c0ba4473574722641d4bfad4b375f908a3
(cherry picked from commit ba0370eef3d17baa70d43723e96eb135c8e4ed58)
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c28592da338ce64f0132901e47bb1834895f6e9e 10-Feb-2017 Andreas Gampe <agampe@google.com> Merge "Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit" am: 851afe56b8 am: 0e01cae667
am: 74acde1bc5

Change-Id: I40d67fcde4d9263d5c75d5c3f782a860dcff93f8
d8502d05136dda6e1ef9fde3098ce8aea59c5c1a 10-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Zygote: Restore GL preload"
ba0370eef3d17baa70d43723e96eb135c8e4ed58 09-Feb-2017 Jesse Hall <jessehall@google.com> Zygote: Restore GL preload

Preloading GLES drivers in Zygote was removed previously since it is
incompatible with updatable drivers. That caused some app startup
latency and system memory use regressions. This change re-adds GLES
driver preloading, but only on devices that don't support driver
updates.

Bug: 34611670
Bug: 35052548
Test: boot angler, systrace of Calculator app startup
Change-Id: Ibdc6b3c0ba4473574722641d4bfad4b375f908a3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
76d4fc84518b3560fc0e8d912a09c1eefefe85ac 08-Feb-2017 Andreas Gampe <agampe@google.com> Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit

Move methods where they belong.

(cherry picked from commit 4e66db8d0c60e89f3a87bb05f38f82bda032ff0f)

Test: m
Test: Device boots
Change-Id: I805c6493078e960ff5b70d84dd93d2da6c7aa797
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4e66db8d0c60e89f3a87bb05f38f82bda032ff0f 08-Feb-2017 Andreas Gampe <agampe@google.com> Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit

Move methods where they belong.

Test: m
Test: Device boots
Merged-In: I805c6493078e960ff5b70d84dd93d2da6c7aa797
Change-Id: I805c6493078e960ff5b70d84dd93d2da6c7aa797
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
46e48b9aa4f8785460c435a7f3697d1717d9320c 02-Feb-2017 Paul Lawrence <paullawrence@google.com> resolve merge conflicts of fde0a41065eb to master

Test: Make sure builds, boots
Change-Id: Idf86dc5d888c09e8a65ada51fc2f32aae6d5570d
fde0a41065ebd5ed0adbe20f4135ca657c6cf271 02-Feb-2017 Paul Lawrence <paullawrence@google.com> Install seccomp into zygote not init am: ef85477470 am: 521d25294b
am: e6e8c7a1dd

Change-Id: I97d2843a2c2940b558f216cf550891a80963be54
ef854774704d61992f13b8c49b9d210bf33ef4a8 31-Jan-2017 Paul Lawrence <paullawrence@google.com> Install seccomp into zygote not init

Bug: 34710876
Test: Boots, correct size filter installed, blocks unallowed calls

Change-Id: I3e66e8724ace37f7d30451b98a5e574766252ea0
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3bb7e5c9097a9e33eea0093e919243a406be6fbc 21-Jan-2017 Jesse Hall <jessehall@google.com> resolve merge conflicts of 5fa7fb1d9f2a to master

Test: make
Change-Id: I7f119535a120303796fcd08f0274269f7d0dbaba
fd104e7fde7f53700da58cbab57d73b938b837a7 20-Jan-2017 Jesse Hall <jessehall@google.com> Load EGL early in Activity launch, instead of in Zygote

Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I6a0f6b90ade21848a10d51ddae62c936f70151b5
Merged-In: I887aa09bd35b088b16f53a89838a0c7c98f15761
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
5fa7fb1d9f2a5b078405c5a63fd7ad05115d71d6 20-Jan-2017 Jesse Hall <jessehall@google.com> Load EGL early in Activity launch, instead of in Zygote

Preloading EGL in Zygote was originally a memory footprint
optimization, but it turns out to be an important app startup time
optimization as well. Preloading EGL in Zygote is incompatible with
updatable graphics drivers, but we don't want to do it on-demand as
part of drawing the first frame either, since that increases
first-frame latency unacceptably.

This change removes Zygote preload, and instead loads EGL on a
low-priority background thread immediately after choosing which
graphics driver to use. This means it is usually done well before
drawing the first frame, without significantly disrupting other
activity launch work.

Test: observe systrace of Calculator launch on bullhead
Bug: 34404021
Change-Id: I887aa09bd35b088b16f53a89838a0c7c98f15761
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
881da84c6b6b7112b165ce433c4d096783227352 17-Jan-2017 Jesse Hall <jessehall@google.com> DO NOT MERGE Revert "Stop preloading EGL/GLES in Zygote"
am: e8ce1276e2

Change-Id: Ib5f68ce3a05cdb6e6f1bba5f6a17d0848e9a27ab
e8ce1276e265340fdd6dd3e964dff00916267f4d 17-Jan-2017 Jesse Hall <jessehall@google.com> DO NOT MERGE Revert "Stop preloading EGL/GLES in Zygote"

This reverts commit 93f630e1c3011a36f6560fd6115cf1a0e809c5e0.
Change has already been reverted in master, hence DO NOT MERGE.

Bug: 34348911
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
2852a28254a5b8b99b2a74554af1dd8e9828c60e 17-Jan-2017 Jesse Hall <jessehall@google.com> 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
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4f6a5b7c43b586d08e49388f3748f7e9832b4e3f 14-Jan-2017 Jesse Hall <jessehall@google.com> Stop preloading EGL/GLES in Zygote
am: 93f630e1c3

Change-Id: Ia177980a2e97a50e7001068aee02372335c09497
93f630e1c3011a36f6560fd6115cf1a0e809c5e0 12-Dec-2016 Jesse Hall <jessehall@google.com> Stop preloading EGL/GLES in Zygote

It's not clear this actually makes much difference on modern
devices/drivers. With updatable graphics drivers, we'd have to be able
to unload the preloaded driver from processes that don't use the
system driver, which is additional complexity and risk.

On bullhead and sailfish, meminfo actually showed slightly more memory
available while sitting at launcher just after boot with this change
than previously. Looking at detailed stats, the differences appeared
to mostly within run-to-run variation, but there wasn't evidence of a
regression.

Bug: 33531483
Test: boot through lockscreen/launcher
Change-Id: I1892302c1750cdbeaf5b9979f8da4dc6bd7b3e75
Merged-In: I1892302c1750cdbeaf5b9979f8da4dc6bd7b3e75
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
9c9cc3e94dd3b07ebf2ab52f1837dd88a64a9b57 12-Dec-2016 Jesse Hall <jessehall@google.com> Stop preloading EGL/GLES in Zygote

It's not clear this actually makes much difference on modern
devices/drivers. With updatable graphics drivers, we'd have to be able
to unload the preloaded driver from processes that don't use the
system driver, which is additional complexity and risk.

On bullhead and sailfish, meminfo actually showed slightly more memory
available while sitting at launcher just after boot with this change
than previously. Looking at detailed stats, the differences appeared
to mostly within run-to-run variation, but there wasn't evidence of a
regression.

Bug: 33531483
Test: boot through lockscreen/launcher
Change-Id: I1892302c1750cdbeaf5b9979f8da4dc6bd7b3e75
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6733e6c6b6f5c49b3c668caae9a8765221c22412 07-Jan-2017 Fyodor Kupolov <fkupolov@google.com> Do not report uptime to tron after runtime restart

Runtime restart doesn't reset the uptime counter. We shouldn't report
boot timings in that case.

Bug: 32807863
Test: manual
Change-Id: If9510c0d5c633acefe70f241e0823da8f6c248a2
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
5a3d0c6e11d9eee40e8134c2efc8fcf6485ce7c5 09-Nov-2016 Narayan Kamath <narayan@google.com> Allow lazy preloading of zygote resources.

Add a flag that controls resource preloading. If set, the zygote waits
until the first fork request to preload resources.

When applied to the secondary zygote, this approach appears to save
between 500-800ms of boot time once the webview RELRO step that uses
the 32 bit zygote is deferred.

Test: Manual
Bug: 32735001

Change-Id: Id387b7132d052fa51b9c25f0142fcd546b99662d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c5b56942024a3211234cf35fed44e3e732143947 11-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge commit '7797e545239e81a9216994527badcc98178ebfcc' into dec10

Change-Id: I430a39241bd2d278eaf1e01b89be3ad368789f6d
740f523b2571d1c4eb4a954e1faedea45dd7fa53 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Final push of installd to Binder; goodbye socket!

Move last two straggling installd commands to Binder and destroy the
socket-based communication channel forever.

Test: builds, boots, apps install fine, pre-OTA dexopt works
Bug: 13758960, 30944031
Change-Id: I9afb9f71858febde34a94f53839b2986493b68a0
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0d0bbd01e93fc716aa4c51bc5d0ad4c0889ccd1b 09-Dec-2016 Jeff Sharkey <jsharkey@android.com> Merge "Prepare to move dexopt calls to Binder." am: d7b144a5e9 am: 35cbe8ffb0 am: 41d75809aa
am: 67c8b01f4d

Change-Id: I1a746e34856b8fa1471ccacd3a8bde1d06866679
c98c7bccdccbff1ceeda501e6a6f8c21d61649ca 07-Dec-2016 Jeff Sharkey <jsharkey@android.com> Prepare to move dexopt calls to Binder.

Since InstallerConnection is about to be replaced by a new installd
Binder interface, this change moves OtaDexoptService to override and
manually cook up the 'dexopt' command line that it expects to collect
from PackageDexOptimizer.

Since OtaDexoptService is designed to be run in isolation, add a new
mode to Installer which ignores calls that aren't being intercepted.

Also moves to a single dexopt() method instead of having overloads.

Test: builds, boots, fake OTA works
Bug: 13758960, 30944031
Change-Id: I3a6a115289f1542d6df3e2993b9720118b7d1e8d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
053a909fd82706e0a213c00e00c397d19b893836 02-Dec-2016 Jeff Sharkey <jsharkey@android.com> Allow system_server to measure emulated stats.

Historically we pushed all system_server SD card interactions through
DefaultContainerService to avoid holding open FDs, but it's safe to
measure disk usage for internal emulated storage when looking
directly at /data/media, since there is no risk of unsafe ejection.

Test: builds, boots, and access allowed
Bug: 33298975
Change-Id: I1491065aad47cd16e7fdd586bce021ff61c003c6
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3235e0c2eeb9f1c3d7152ebc2738a2e784085d38 17-Nov-2016 Fyodor Kupolov <fkupolov@google.com> Additional boot metrics

Extracted duration measurement functionality into BootTimingTraceLog.
It is now shared between system_server and zygote.

Log the following metrics to tron:
- boot_zygote_init - Time in milliseconds to boot into Zygote init stage.
- boot_android_init - Time in milliseconds to boot into Android init stage.

Test: manual - device boots, metrics are logged to system/event log
Bug: 32780225
Bug: 31115337
Change-Id: I600ac7fc83d35fa226ac92c37cc4b19192b25f59
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
fdfc79a8788aefe7a26d54a85c14398602811165 01-Nov-2016 Andreas Gampe <agampe@google.com> Merge "Zygote: Avoid string concatentation for systrace"
am: 8bcd159234

Change-Id: I484e5a56b790f57d097970f727959438debafafb
c425362049390c61c0654ea2510f5c5c1db8588e 29-Oct-2016 Andreas Gampe <agampe@google.com> Zygote: Avoid string concatentation for systrace

Avoid the allocation of an unneeded string. With more than 4000
classes being preloaded, this adds up.

Test: m
Test: device boots
Change-Id: I61f10f61ebdd08d17e09aaedd8bf54cc40c41838
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
aa3c463a5ba487c40a21a6a9709585e0b94fe792 13-Oct-2016 Robert Sesek <rsesek@google.com> resolve merge conflicts of 0b58f19 to nyc-mr1-dev-plus-aosp

Change-Id: I374d842cab49b58b570d5ad7ef3dffb7b148d236
d414158f7926511ad7e212cdaaeba69e1a3b8fda 12-Oct-2016 Robert Sesek <rsesek@google.com> resolve merge conflicts of 7031dac to nyc-mr1-dev-plus-aosp

Change-Id: I71fbde71dd97abab77f798b621972fb1d26af799
8f8d187a78b48109911a800ba5993b645d3015c5 18-Mar-2016 Robert Sesek <rsesek@google.com> Split the zygote logic out of android.os.Process into a new ZygoteProcess class.

There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
(cherry picked from commit 94e824bc1b5f83024b7c9a228a8f2d0cd1347d11)
(cherry picked from commit 96b49848e7784bc4b40ffd01e2524461e1efcab7)

Change-Id: I2e12057e4c2e7567f909d699b487e70b1664cca8
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dd4bb31639047b27118d44b9a0609952fac6debf 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)
(cherry picked from commit b9679dc1fad508a001e30a941148e1bdc3fe953f)

Change-Id: Iefdb0784dd08ac09a23aafe18663c13dce421775
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
629ad7e37ea3ef08e6fcc843fc268884965ceb20 07-Oct-2016 Dimitry Ivanov <dimitry@google.com> Merge "Relax namespace restriction on system server classloader" am: a8135325c1 am: 3c6b4961cb
am: 097ff24545

Change-Id: I9fcc4eeb399da4bdfef2a415e175f2a59f332c84
3c6b4961cb8092659c409dd9887a2d0543c040c1 07-Oct-2016 Dimitry Ivanov <dimitry@google.com> Merge "Relax namespace restriction on system server classloader"
am: a8135325c1

Change-Id: Ie6b5e9041c1a03a8a6b2343069ef2a37b9aba9aa
9e9061f608abc6ae76f1b190c62ad5336f65ec89 20-Sep-2016 Dimitry Ivanov <dimitry@google.com> Relax namespace restriction on system server classloader

Add java.library.path to list of permitted paths
for system server classloader. This allows libraries
loaded in system server classloader namespace to
dlopen libraries under /system/lib/somedir

Test: m
Bug: http://b/31652397
Change-Id: Ief70aaa81cde4983c8de1e07b4ef23e1fadf35a0
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
1201509679cd65bfb5550c9a29cfb806a0b4e978 16-Sep-2016 Robert Sesek <rsesek@google.com> Move art::Runtime::InitZygote logic from art into frameworks/base. am: e4f8d69c58 am: c1b32fc3ea
am: 5189f86a36

Change-Id: I495848744c205295d18211c977b64f3a437ec27a
c1b32fc3ea2d215a1910504c559c3e99909614ec 16-Sep-2016 Robert Sesek <rsesek@google.com> Move art::Runtime::InitZygote logic from art into frameworks/base.
am: e4f8d69c58

Change-Id: Ia6fdf02ba9d7cd6e473d2891d5b8e59b4e967347
e4f8d69c58e3e0a54b1434d64217d30e8d448864 14-Sep-2016 Robert Sesek <rsesek@google.com> Move art::Runtime::InitZygote logic from art into frameworks/base.

Test: m
Test: aosp_angler-eng boots
Change-Id: I964c70576136e7424797140b2f7d179e70298c44
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
96b49848e7784bc4b40ffd01e2524461e1efcab7 18-Mar-2016 Robert Sesek <rsesek@google.com> Split the zygote logic out of android.os.Process into a new ZygoteProcess class.

There is no functional change. This is to support adding new types of zygotes
that all operate using the same protocol.

Bug: 21643067
(cherry picked from commit 94e824bc1b5f83024b7c9a228a8f2d0cd1347d11)

Merged-In: Ie673ee816cae34ac20ffb8c774ec3e6461c3fd0a
Change-Id: I104e6133a90dc93a9854836b5e92d3cd542163a3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.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/ZygoteInit.java
0d42671cc586af881ee31128c8f726adc3e1b715 11-Aug-2016 Andreas Gampe <agampe@google.com> Zygote: allow system server compilation to fail am: e7bc152c20
am: 8253782f5b

Change-Id: I1fc916e9db2e391975b0037853cbfda9b08c706a
e7bc152c20a21dfa76bdf0f2f129fc0ccf38761d 10-Aug-2016 Andreas Gampe <agampe@google.com> Zygote: allow system server compilation to fail

Do not terminate when the system server classpath cannot be
compiled. This can be the case in fallback mode, e.g., when
a device ran out of space.

Bug: 30765660
Change-Id: I3aca3f2f789e2201e4019e1bf04d239ab54b0d3d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
15cb51e04a8c1f71120b63b8ce9b3bc4dfd71279 03-Aug-2016 John Stultz <john.stultz@linaro.org> Merge "Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms" am: 1085be0ce3 am: 5e23ab394a
am: 55b3a9ceb3

Change-Id: Iaf49bda287e258e54ebf72ef1837dfb5f528eecc
5e23ab394a9d15925be5775acf8551773e502df2 03-Aug-2016 John Stultz <john.stultz@linaro.org> Merge "Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms"
am: 1085be0ce3

Change-Id: I23d7c2af33db8621b0c3b3415669543e0e3b740f
5733f387be6cef3836ed06ed897ab43897eb470d 28-Jul-2016 John Stultz <john.stultz@linaro.org> Zygote: Add CAP_WAKE_ALARM to system_server to properly support timerfd alarms

The when the timerfd alarm logic was added to the kernel, an oversight was made
and the interface does not check for the CAP_WAKE_ALARM permissions as required
via other kernel methods to trigger an alarm timer.

In v4.8-rc kernels, the change 2895a5e5b3a ("timerfd: Reject ALARM timerfds
without CAP_WAKE_ALARM") was added by Eric Caruso <ejcaruso@google.com>.

After this change (which may be backported to -stable), the AlarmManager will
fail on the first timerfd_create call, and will not be able to set the time
or handle other necessary functions.

The solution here is to add CAP_WAKE_ALARM to the system_server process.

Change-Id: Ifdb16f3ef42711e553f727165de3922d484b5be4
Signed-off-by: John Stultz <john.stultz@linaro.org>
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ea8b5de33dc4aa446cd22fd0e4a9253216ac4086 18-Jun-2016 Christopher Ferris <cferris@google.com> Catch throwable exceptions.

If the zygote dies early enough, certain exceptions disappear and never
result in an error message in the log. Fix the code to catch all
Throwable exceptions so that an error message does not result in a
silent restart of the zygote.

Bug: 29400363
Change-Id: Ib044006629ea4441728921f3c587d0cb295ec745
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
80755a5a25de5b7c9f2d61e6dba7c2a4656bca89 17-May-2016 Sergio Giro <sgiro@google.com> ZygoteInit: install AndroidKeyStoreProvider in the Zygote

Instead of in activity thread. That way, we can warm up (ie,
precompute cached values) this provider and AndroidBCWorkaroundProvider
(which are installed together) so that the computation doesn't
happen in the app. As a result, the time spent in the first call to
SSLSocketFactory.getDefault() decreases by ~5ms in angler userdebug.
Measured with an app calling SSLSocketFactory.getDefault in onCreate
and timed it with System.currentTimeMillis() .

(cherry picked from commit 69de32071c8ca7fa2277e4340a320b7df6fe963d)

Bug: 28545496
Change-Id: Ic4e11d058fb404eaa92db925a3e765fc3bef7ae2
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
761f70d5a6b926780db3bba95ee1e01b4d8d95be 20-May-2016 Neil Fuller <nfuller@google.com> Merge "Add support for ICU data pinning in the Zygote" into nyc-dev
3eb06806429f444fe87b894308681e20e6871c7d 19-May-2016 Sergio Giro <sgiro@google.com> Merge "ZygoteInit: install AndroidKeyStoreProvider in the Zygote" into nyc-dev
am: 44b9f13f9c

* commit '44b9f13f9cfaf2e1136a1f2baab54b229d221fe4':
ZygoteInit: install AndroidKeyStoreProvider in the Zygote

Change-Id: Ia20b312dfd8181fadd38f075817630a1c5ab518f
69de32071c8ca7fa2277e4340a320b7df6fe963d 17-May-2016 Sergio Giro <sgiro@google.com> ZygoteInit: install AndroidKeyStoreProvider in the Zygote

Instead of in activity thread. That way, we can warm up (ie,
precompute cached values) this provider and AndroidBCWorkaroundProvider
(which are installed together) so that the computation doesn't
happen in the app. As a result, the time spent in the first call to
SSLSocketFactory.getDefault() decreases by ~5ms in angler userdebug.
Measured with an app calling SSLSocketFactory.getDefault in onCreate
and timed it with System.currentTimeMillis() .

Bug: 28545496

Change-Id: I73284eccdf6d51dbf55206335d759ccf795c5f41
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4f41f6198baf60cdb9992736dc7682ae7e291e0e 09-May-2016 Neil Fuller <nfuller@google.com> Add support for ICU data pinning in the Zygote

Upstream ICU caches use SoftReferences. On Android this means
that useful cached data initialized in the Zygote are "lost" when
the Zygote GCs and cannot be shared with apps. This change makes use
of an Android patch to ICU to ensure References created during
Zygote initialization are "strong". i.e. they are never collected.
This prevents them being GCd and ensures they can be shared between
applications.

After switching ICU to use strong references, this change
also creates DecimalFormatSymbols objects for common ULocales
(ROOT, US and the user's default, if different). DecimalFormatSymbols
makes use of an ICU Reference cache and this alone has been shown to
improve the construction time of java.text.DecimalFormat by 1-1.5
milliseconds on a Seed device. This saving applies the first time one
is created in each app for each locale, and again if SoftReferences
have been cleared.

The cost to the heap size of the Zygote has been measured at ~107k.
This value will change as more caches are switched to use the new
CacheValue class.

Formatting is typically performed on the UI thread and the intention
of this change is to reduce app start up time and jank in apps like
the Dialer which do a lot of formatting when scrolling lists. The
change may also enable more virtual memory page-sharing between
apps, though this is not the specific goal.

Bug: 28326526
(cherry picked from commit 41c9dc3b6938c5674c88ef4bc27b3d95f56efebe)

Change-Id: I48e4d57ecbb207b9a5e17b6caf5e7b282e4a40e3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c724f2207f9186f25eeac5b2131e469dafb3bc90 18-May-2016 Neil Fuller <nfuller@google.com> Merge "Add support for ICU data pinning in the Zygote" am: 9b1d64410d
am: 8491b4c05d

* commit '8491b4c05d35b15e0a4c1a0ef2396cbb7169698a':
Add support for ICU data pinning in the Zygote

Change-Id: I64ba8a96ab8990a051a68cbdb35f4b1de3738d09
41c9dc3b6938c5674c88ef4bc27b3d95f56efebe 09-May-2016 Neil Fuller <nfuller@google.com> Add support for ICU data pinning in the Zygote

Upstream ICU caches use SoftReferences. On Android this means
that useful cached data initialized in the Zygote are "lost" when
the Zygote GCs and cannot be shared with apps. This change makes use
of an Android patch to ICU to ensure References created during
Zygote initialization are "strong". i.e. they are never collected.
This prevents them being GCd and ensures they can be shared between
applications.

After switching ICU to use strong references, this change
also creates DecimalFormatSymbols objects for common ULocales
(ROOT, US and the user's default, if different). DecimalFormatSymbols
makes use of an ICU Reference cache and this alone has been shown to
improve the construction time of java.text.DecimalFormat by 1-1.5
milliseconds on a Seed device. This saving applies the first time one
is created in each app for each locale, and again if SoftReferences
have been cleared.

The cost to the heap size of the Zygote has been measured at ~107k.
This value will change as more caches are switched to use the new
CacheValue class.

Formatting is typically performed on the UI thread and the intention
of this change is to reduce app start up time and jank in apps like
the Dialer which do a lot of formatting when scrolling lists. The
change may also enable more virtual memory page-sharing between
apps, though this is not the specific goal.

Bug: 28326526
Change-Id: Ia2c73f6525f05b1aa81e57a31eed1616decf6bb5
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
57b8a73d0eb554eff12f6f6bc8d85cbc81897f0c 17-May-2016 Sergio Giro <sgiro@google.com> ZygoteInit: remove extra copy of method DO NOT MERGE ANYWHERE

The method warmUpJcaProviders arrived here from both nyc-dev
and aosp/master, removing duplication.

Change-Id: I2d91ee38fe93f600bec89651416e84ab83ef9d4a
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
9d95ab47ff318ebb30804dce0890b4de414d5844 17-May-2016 Sergio Giro <sgiro@google.com> Merge "ZygoteInit: warm up JCA providers during preload" am: aa733e0b41
am: ef42102cf8

* commit 'ef42102cf8d0dd238deb1871bef07f9646622a91':
ZygoteInit: warm up JCA providers during preload

Change-Id: I7c8ed5394af0c6e1fd25b289ca615125c4e3c38e
b07595d1941a25b5f82c62f9b7099c3c77d06056 13-May-2016 Sergio Giro <sgiro@google.com> ZygoteInit: warm up JCA providers during preload

This makes the time spent in the first call of an app to
SSLSocketFactory.getDefault() drop from ~240 ms to ~50 ms. In M
it was around ~6ms. This is due to the fact that, while instantiating
the default factory, all providers are initialized.

In order to obtain the timings above, I created an app calling
SSLSocketFactory.getDefault in onCreate and timed it
with System.currentTimeMillis() .

(cherry picked from commit 6cb7b1c4765e9bc5175056826523dbd88426e9aa)

Bug: 28545496

Change-Id: Ic5aab3ece609d9fef06fee4ccb83d8371af075b2
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
5a68af384037f2980215dd45b91c5165c779d4e8 17-May-2016 Sergio Giro <sgiro@google.com> Merge "ZygoteInit: warm up JCA providers during preload" into nyc-dev
6cb7b1c4765e9bc5175056826523dbd88426e9aa 13-May-2016 Sergio Giro <sgiro@google.com> ZygoteInit: warm up JCA providers during preload

This makes the time spent in the first call of an app to
SSLSocketFactory.getDefault() drop from ~240 ms to ~50 ms. In M
it was around ~6ms. This is due to the fact that, while instantiating
the default factory, all providers are initialized.

In order to obtain the timings above, I created an app calling
SSLSocketFactory.getDefault in onCreate and timed it
with System.currentTimeMillis() .

Bug: 28545496

Change-Id: I650d4b0435e67e481a41e02b0b538ce5cc993fa3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
7bd0fdd639640f9ddffbffa6a117644134d8be30 29-Apr-2016 Philip Cuadra <philipcuadra@google.com> Pinner service for pinning files into memory

Pin key files into memory to prevent having to fetch from flash
after boot. Improves system performance by preventing page cache
thrash. Retrieves files from a device-specific overlay to allow
specialization.

bug 28251566

Change-Id: I8532f52bd70271794dd7576976d13a524849ce7b
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0c6e213dc70575d5a29c29bf7eb360b1c482b978 27-Apr-2016 Dimitry Ivanov <dimitry@google.com> Merge changes I12c9448e,I928175a3 into nyc-dev

* changes:
Create linker namespace for the system server classloader
Extract pathclassloader initialization to a separate class
89dad3360ea6ae2fa0c4eb70a760b8d6bcb98b82 21-Apr-2016 Dimitry Ivanov <dimitry@google.com> Create linker namespace for the system server classloader

Bug: http://b/27702070
Change-Id: I12c9448e877202937cf558de75042bcb46f6a933
(cherry picked from commit eb5866d4b05b6c000385be4a536544e27ca13335)
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c7b9482b0c4bb2d378e63541b96be45c50094e05 16-Mar-2016 Jeff Hao <jeffhao@google.com> Support to pass <uses-library> option through to dex2oat.

This change takes an app's shared libraries specified by <uses-library>
and passes it through to dex2oat to be used during compilation.

Part of a multi-project change.

Bug: 26880306

(cherry-picked from 7b331b6a8ae8d9f10482b292439457de98abd32a)

Change-Id: I523b1b74775e7ed27072498509e743f1f10b1164
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
eb5866d4b05b6c000385be4a536544e27ca13335 21-Apr-2016 Dimitry Ivanov <dimitry@google.com> Create linker namespace for the system server classloader

Bug: http://b/27702070
Change-Id: I12c9448e877202937cf558de75042bcb46f6a933
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
1ef8aef260c19236be023c429b41a46e7f5da8b0 11-Apr-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Add no-thread marking to zygote

Use ZygoteHooks code to mark zygote initialization to not be
allowed to create threads. This is helpful when new classes are
found to be used by apps but cannot be preloaded as they spawn
threads.

Bug: 27248115
Change-Id: I1dc3620d9e7d0054c672b993d89459fc4b353dfc
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
288e3f50dd3ae5288566fde969ef547816babace 29-Mar-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Refactor package manager

Minimal cherry-pick to keep things alive.

Bug: 27689078

(cherry picked from commit bdd30d86ef98456161069d11481b2ccd25a11b4e)

Change-Id: I06b9d75f58c59cb07ef5170f784ea6745168efaa
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
bdd30d86ef98456161069d11481b2ccd25a11b4e 20-Mar-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Refactor package manager

Introduce a mapping between dexopt reasons and compiler filters. Use
reasons in package manager and other classes, where possible.

Change PackageDexOptimizer to accept a compilation filter. Adapt for
the split-out profile merging. Pass compilation filter to installd.

Bug: 27689078
Change-Id: I8c0ea6f10fbfdbd096adecc52abfd2466d048fdc
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
2a8749354a7d9759e91bf0885f58cfc40081d846 21-Mar-2016 Elliott Hughes <enh@google.com> Merge "Changes of root storage space unmounting time on Zygote Process"
885b742bb66660947d8335e9a4f5a4eef2e45ff9 20-Jan-2016 doheon1.lee <doheon1.lee@lge.com> Changes of root storage space unmounting time on Zygote Process

Zygote process forks every child process for launch the SystemServer and other
applications. When child process is forked, unmount storage inherited
from Zygote process is executed before it gains its own root storage
space.
If Zygote have no storage spaces, unmount operations not needed to
get relevant permission storage space.
Thus unmount is executed only once shortly before the SystemServer is forked.
And the child processes do not unmount its inherited root storage space.

Change-Id: I311ca7ea2c93085f42579f8cf8bdc7ef1d570a04
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6ce213fe2cf78b60dd0f2a26c4f591b85a8e9663 08-Mar-2016 Calin Juravle <calin@google.com> Update DexFile.getDexOptNeeded in framework

Partial cherry pick from commit 693f997cc8b8c2ba8d3ed29627b2641dd86392a5

Change-Id: I0fe34541e3cf77fb6e6dbe689b7cf55cb78dbe05
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0c9ef61944e883219dd167f765a504ab8cdb7710 03-Mar-2016 Calin Juravle <calin@google.com> Merge "Better handling of various types of compilation in DexOptimizer" into nyc-dev
693f997cc8b8c2ba8d3ed29627b2641dd86392a5 25-Feb-2016 Calin Juravle <calin@google.com> Better handling of various types of compilation in DexOptimizer

From the runtime perspective extract-only/profile-guide-compiled/fully-
compiled oat files are up-to-date and don't need dex2oat. However,
wihout knowing the exact "class" of the aot file we are not able to do a
full compilation of something previously only-extracted, or limit
profile-guide compilation to only previously profile-guide or extract-
only oat files.

GetDexOptNeeded now accepts a mask of desired types of compilation
that the runtime takes into account when advising what's needed.

This CL adds the necessary handling in DexOptimizer.

Also:
- removes the contraint to use extract-only oat files only when
profiles are enabled.
- removes mDexOptPerformed which interfere with the different types of
compilation and only saved a call to GetDexOptNeeded.

Bug: 27189430
Change-Id: Iced2bdcc3aa7866ff888a3bace43f4b71fffb353
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ddc1397eba25e17591e3491dddb192b3fa38100f 27-Feb-2016 Andreas Gampe <agampe@google.com> Frameworks/base: Refactor TextView initialization

To allow static initialization of a number of View classes based
on TextView, refactor the initialization of the font cache to be
explicit from the zygote.

Bug: 27265238
Change-Id: I1b71086d3f49d8b3e72eea2bf8359351d25fc0fd
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
289e4fa6585744d04996262e9e5b54695a7b66c1 20-Jan-2016 doheon1.lee <doheon1.lee@lge.com> Changes of root storage space unmounting time on Zygote Process

Zygote process forks every child process for launch the SystemServer and other
applications. When child process is forked, unmount storage inherited
from Zygote process is executed before it gains its own root storage
space.
If Zygote have no storage spaces, unmount operations not needed to
get relevant permission storage space.
Thus unmount is executed only once shortly before the SystemServer is forked.
And the child processes do not unmount its inherited root storage space.

Change-Id: I311ca7ea2c93085f42579f8cf8bdc7ef1d570a04
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
db4a79a5d7d348e9d2286d95d4e5a59dd484456f 23-Dec-2015 Calin Juravle <calin@google.com> Enable profile guided compilation on the framework side

The background compilation service will trigger a profile based
compilation instead of a full one. If no profile information is
available the compilation is skipped (see installd).

Note that the end decision whether or not to compile a package is taken
by dext2oat. We can't make the decision here because this service runs
under system server which cannot read app's profile data.

Bug: 26080105
Change-Id: I457ea8dea0557839c1f7cdc241770055732b0a4a
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
fdeeeea6cfdebdb98dd70a7dd48965743af01750 12-Jan-2016 Jeff Sharkey <jsharkey@android.com> Follow installd changes, throw exceptions.

Start by passing down flags to work on both CE and DE storage areas;
a future change will refine this further.

Force consistent argument checking and null handling for all
installd callers. Throw explicit exceptions instead of returning int
values that can accidentally be ignored.

Bug: 26466827
Change-Id: Iddb591f6b3c7786d210d3f132ff7f9886a97b749
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
fbd5904ce690491b813ebf815a7e33083bc59ea0 24-Nov-2015 Pavlin Radoslavov <pavlin@google.com> Use GID "wakelock" to control access to kernel wakelock

* Added GID "wakelock" (3010) to the list of groups the System Server
belongs to.

* Added GID "wakelock" to the list of assigned groups for the
"android.permission.BLUETOOTH_STACK" Android permission.

* Grant CAP_BLOCK_SUSPEND to processes that belong to GID "wakelock"

Bug: 25864142
Change-Id: I8a9a5f11e4a9ecd1abf2d4f4b90ec89b3101332e
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
701662547341269d610ac5f093e449a4c7078e43 24-Nov-2015 Pavlin Radoslavov <pavlin@google.com> Use GID "wakelock" to control access to kernel wakelock

* Added GID "wakelock" (3010) to the list of groups the System Server
belongs to.

* Added GID "wakelock" to the list of assigned groups for the
"android.permission.BLUETOOTH_STACK" Android permission.

* Grant CAP_BLOCK_SUSPEND to processes that belong to GID "wakelock"

Bug: 25864142
Change-Id: I8a9a5f11e4a9ecd1abf2d4f4b90ec89b3101332e
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
811dc3b42b4d3c967a2304bf1e01840147b1a528 23-Nov-2015 Filip Gruszczynski <gruszczy@google.com> Allow preloading of freefore multi window drawables.

Bug: 25081468
Change-Id: Ic6ec6050882e5362e1ab8734962d163fff04b53d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0afcfdca963f4cefcb90ac7061aafe3985875145 09-Nov-2015 Nick Kralevich <nnk@google.com> Merge "system_server: allow /proc read access to other UIDs" am: 51b48b3877 am: 02cc328d9d
am: 7907271af1

* commit '7907271af1f9024b1c5896a2d5006f7c868c771c':
system_server: allow /proc read access to other UIDs
368513fa991c66b63194a68ded444f451c5283ec 08-Nov-2015 Nick Kralevich <nnk@google.com> system_server: allow /proc read access to other UIDs

Add system_server to AID_READPROC, to allow system_server to read
/proc entries associated with other UIDs.

Bug: 23310674
Change-Id: I1602b8ee30670cde4ed56e2f901524c105895352
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
5dd239a1f8e305013ee782e45e7e789ec531e9d1 06-Oct-2015 Luis Hector Chavez <lhchavez@google.com> Make ZygoteInit not require CAP_BLOCK_SUSPEND

We are dropping CAP_BLOCK_SUSPEND since that prevents correct suspension in
Chrome OS. This change makes it so that it only requests that capability if it
is not running inside a container.

TEST=Android boots correctly
BUG:24952794

(cherry picked from commit 5e38447a9bf81bb7d58d33c71498495e1e0f575f)
(cherry picked from commit dc3943951ee475ef09cc7a4825368f9b707e1344)

Change-Id: If39357f22955442d5532d1408ce74360384521bb
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
56ebb257085ffed21c98ba98ced959ffe6afaca3 26-Sep-2015 Todd Kennedy <toddke@google.com> resolved conflicts for 389bb7f5 to master

Change-Id: I9c3474577166cc91c50d32d225957fbd13c205bf
9f8602644418ecfb1a5c9555792ceed285fa72bd 26-Sep-2015 Todd Kennedy <toddke@google.com> resolved conflicts for 7de7e0b0 to stage-aosp-master

Change-Id: I4e45e5bbaebb98b0e740167eaf7517f99d917f30
fa54ab7950b7ad7605cb842b47826b71a685bc28 25-Sep-2015 Todd Kennedy <toddke@google.com> Pass dexopt flags as integer

Instead of using a series of booleans, create a single flags integer
that contains all of the dexopt options.

Change-Id: Ia8fa968f64b164267f43dd29cea9dc0413058125
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
4e321745173de1eb89343238fadfbcc7ba1a88f9 24-Sep-2015 Todd Kennedy <toddke@google.com> resolved conflicts for cafacef6 to stage-aosp-master

Change-Id: Id02e098a02aede327c5bc1a98aa177d8bf9ec5a9
55fe944f987bcbdea8bbec7ea411684f69623da4 21-Sep-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Propagate boot status to installd

Propagate the boot status explicitly to installd so that we do not
have to rely on dev.bootcomplete, which isn't meaningfully set
when the device needs the decryption screen on boot.

Bug: 23898216
(cherry picked from commit 06bb908b78e3c790d3db52fef9f2ab0a129e53cd)
Change-Id: I9b34298caf70b1e5d40970cc0d04c469016a80a7
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
bc68463602b6c26cca8988e55df8dbf48ca653e5 22-Sep-2015 Andreas Gampe <agampe@google.com> resolved conflicts for 5d7b68d4 to master

Change-Id: I6f56e8e11c35733f8d84346ca2b9a201784552e1
5d7b68d4914c8ddb0171abd1f668716ff682fd84 22-Sep-2015 Andreas Gampe <agampe@google.com> am 53ed452e: am 9ce68b24: am b49245f9: Merge "Frameworks/base: Propagate boot status to installd" into mnc-dr-dev

* commit '53ed452e86aa186b5903b65057b4473629292f0d':
Frameworks/base: Propagate boot status to installd
06bb908b78e3c790d3db52fef9f2ab0a129e53cd 21-Sep-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Propagate boot status to installd

Propagate the boot status explicitly to installd so that we do not
have to rely on dev.bootcomplete, which isn't meaningfully set
when the device needs the decryption screen on boot.

Bug: 23898216
Change-Id: I9b34298caf70b1e5d40970cc0d04c469016a80a7
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f9fba9802578adce8a1d0125329f7e4f930a5f84 04-Sep-2015 Yasuhiro Matsuda <mazda@google.com> am e651ee9b: am 10191dd9: am 53f1a815: Merge "Remove unnecessary finally blocks for tracing."

* commit 'e651ee9bef73c00c3ca1f1ed57485a6c06b802fd':
Remove unnecessary finally blocks for tracing.
10191dd9d20f589fd6f7868a350c104372a57687 04-Sep-2015 Yasuhiro Matsuda <mazda@google.com> am 53f1a815: Merge "Remove unnecessary finally blocks for tracing."

* commit '53f1a815b4401f10cd833217143da44ab0408dcc':
Remove unnecessary finally blocks for tracing.
25878b288846831048e157271c635d31d1c7557b 03-Sep-2015 Yasuhiro Matsuda <mazda@google.com> Remove unnecessary finally blocks for tracing.

BUG: 22207144
Change-Id: I2b15bb7c4055a1ad589b433d4f253868813ab311
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6d444185e55315a0111162609b1f619ee268bf3a 02-Sep-2015 Yasuhiro Matsuda <mazda@google.com> resolved conflicts for merge of fcf9ab5a to master

Change-Id: I69ad6e525430c5c4fc3c274b8bf6ebf653716124
ebf9465d213336819b15e3b21d02afce64470d4f 02-Sep-2015 Yasuhiro Matsuda <mazda@google.com> resolved conflicts for merge of ef57e5e0 to stage-aosp-master

Change-Id: I1c31b38936dc74619dea27f0d5eecab43360bb8c
1ab43d5978813f56899dbd3115fd7d9f96b4fe55 30-Jun-2015 Yasuhiro Matsuda <mazda@google.com> Add trace code to system server.

- Add TRACE_TAG_SYSTEM_SERVER for tracing system server code.
- Add a few more tracing code to the code paths related to boot.

BUG: 21739901
BUG: 22207144
Change-Id: I08b424d2f83783f512c3818394099909cd55f327
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
2b40e7076dcd898bab87f0817b74a008756e4be5 24-Jun-2015 Makoto Onuki <omakoto@google.com> am 9e2d1ed8: am b96bc804: am 0633ae74: Merge "Actually wait for installd" into mnc-dev

* commit '9e2d1ed898b8e4a4971ddb511e221e3406bf797a':
Actually wait for installd
c8a2cfed0192afc6a408f4bdb77e8a0bdd5d752b 24-Jun-2015 Makoto Onuki <omakoto@google.com> Actually wait for installd

Bug 19337445

Change-Id: I70bdaa0ac3695ac9d03ba34fe9d35fe775a5300d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
b8850932d766007b7a177ad2cbcaf08bfc1dcc9c 11-Jun-2015 Steve Paik <spaik@google.com> Merge "Disable AssetAtlasService when PRELOAD_RESOURCES is turned off"
3c27a2303fdb6b222b7b7628fea7bc3c159990ff 11-Jun-2015 Steve Paik <spaik@google.com> Disable AssetAtlasService when PRELOAD_RESOURCES is turned off

Change-Id: Ie77810219c8d5dbff7e9364b60db2d1ea50bd685
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c6432e5c7284f6e15c2601c0725bd1a8f14c7af3 23-Jul-2013 Kevin Tang <zhikait@codeaurora.org> add gps gid to system_server

system_server hosts gps service, it should pocess gps
gid, so it can communicate with native gps daemons.

Change-Id: I59d7e99ec996891b19fa15a3ed66e055e6bccad8
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
825af5fba96d9de4a49e57c6a4c97b8f2bb609fa 22-Apr-2015 Andreas Gampe <agampe@google.com> am 5d3aea2e: am c7f9f765: am 189d2785: Merge "Frameworks/base: Fix comment"

* commit '5d3aea2e5d052041a81bf49154ceedb9d96e2918':
Frameworks/base: Fix comment
dd8e5fbe96ecdf95ce8629ca5c6e1d8c520ecff4 21-Apr-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Fix comment

Fix comment in ZygoteInit.

Change-Id: I853581c8d44ee52ee8e113c67ea68621643ecb39
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c147278276257ea95fc6999a1bd6f4b64a4d68d9 21-Apr-2015 Andreas Gampe <agampe@google.com> am 3bbd87dd: am 1f4f92ed: am b6feabcf: Merge "Frameworks/base: Use better Class.forName in ZygoteInit"

* commit '3bbd87dd1f6b7f6b767885a56ad062897bb25642':
Frameworks/base: Use better Class.forName in ZygoteInit
c917f74d9235feefd1788a7b9ba34ed8f1215850 21-Apr-2015 Andreas Gampe <agampe@google.com> Frameworks/base: Use better Class.forName in ZygoteInit

Use the three-argument version of Class.forName. This saves an
expensive stack lookup for the caller's class-loader on each
invocation.

Bug: 19498458
Change-Id: I859affde31e580fd2de3f70ee0a9295936c2d9f4
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
a1b19b7b66b06647501bc80d3002701fd9e59b7a 09-Apr-2015 Richard Uhler <ruhler@google.com> am 00ff42a0: am 7f757130: am f324d245: Merge "Reuse dexopt method for both dex2oat and patchoat."

* commit '00ff42a0ca9d17c4b7ee89d900cf86c9a25c00eb':
Reuse dexopt method for both dex2oat and patchoat.
c3dd1c1b91b4e47c3b141944be68037ec2d607d8 06-Apr-2015 Raph Levien <raph@google.com> Load hyphenation data at Zygote init

Loading hyphenation data on demand can cause UI jank (and can be a
strict mode violation). This patch explicitly loads the data at
Zygote init time. It also chooses /system/usr/hyphen-data as the path
for this data.

Bug: 20060770

Change-Id: Idac68e3971f8638f1d70960594bf6c1050bb23d6
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
7b08b35bde3df58816b171b88712bcc6d21dcbe8 26-Mar-2015 Richard Uhler <ruhler@google.com> Reuse dexopt method for both dex2oat and patchoat.

Change-Id: Ib9a6373f98474f1242367b5285086251a9d580e5
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
01b50bb06b5cdeef57d7d69870402fb893a70dea 19-Feb-2015 Narayan Kamath <narayan@google.com> am 907bcd96: am 644ebc88: am 0a7936b7: Merge "Fix a couple of issues with system_server forking."

* commit '907bcd96d7f54adaf3b3df6f476e09c636c646cf':
Fix a couple of issues with system_server forking.
0a7936b7c54fb7dff0406a40452cb0242f66a067 19-Feb-2015 Narayan Kamath <narayan@google.com> Merge "Fix a couple of issues with system_server forking."
cc34625cb76b7a4b551c1460a4f998032825410b 16-Feb-2015 Piotr Jastrzebski <haaawk@google.com> am 07aaff33: am 58524b2a: am e7e92381: Merge "Register DDM handlers at the beginning of main method."

* commit '07aaff33ef0e61dfbb15188c5aae0624dc9524a9':
Register DDM handlers at the beginning of main method.
b6b044ae8263d1104e249ad2b857f0c570309990 13-Feb-2015 Narayan Kamath <narayan@google.com> Fix a couple of issues with system_server forking.

- Remove the obsolete --runtime-init arg. its prescence
was preventing other arguments from being parsed.

- Be stricter about unparsed args - throw if we see arguments
we don't expect. This was already implemented but broken
(probably implemented by a crap programmer).

bug: 19378905
Change-Id: Id8b6158db7ef6368dd13ae61f591cdf2b278dfd1
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
da74a628f55fe32a8f8d8542689032f4f6f1c44c 12-Feb-2015 Piotr Jastrzebski <haaawk@google.com> Register DDM handlers at the beginning of main method.

Compiler initializes RuntimeInit during compilation and stores an
initialized version of the class in oat file. Same thing happens to
DdmServer which handles DDM packets in JDWP thread started during JVM
creation. This means that after the creation of JVM all
DDM packets are handled by DdmServer.dispatch and since it's already
initialized during compilation it has all framework related handlers
already registered. If a packet arrives before AndroidRuntime.startReg
is called then framework native methods are not yet registered and the
processing of the packet fails with UnsatisfiedLinkError.

To fix this problem the registration of framework related DDM handlers
is moved to the beginning of ZygoteInit.main and RuntimeInit.main. This
means that the handlers won't be registered until main method is called
and that's guaranteed to be after AndroidRuntime.startReg is called. It
also guarantees that DDM packets will be properly handled as soon as
Java code is executed.

Bug: 18081539.
Change-Id: I9c674f53f3f62d58c46886e0b60698182e08f0c3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
77bb6f179a5495c90470f910d46667d8306ae010 12-Feb-2015 Alan Viverette <alanv@google.com> Stack alert dialog buttons when they are too long

Change-Id: Id1c0b8c0a8fd1c9949b15269fba52e88ef826e6b
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
37ad4b0242579d9a7251c8683eb20645be44cea8 19-Jan-2015 Narayan Kamath <narayan@google.com> Choose the right executable for wrapped applications.

64 bit zygotes should exec app_process64, whereas 32 bit
zygotes should exec app_process32.

Change-Id: I63b56400e0478cd2bb206c98da6858be558f0525
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f48029f00a66e23d7872a00b56fbcf88528ba476 08-Jan-2015 Narayan Kamath <narayan@google.com> Remove support for --classpath and make --runtime-init the default.

--classpath hasn't been properly supported or used for as long as
git history exists, and the non --runtime-init classpath is useless
without it.

Also, forking and exec' a bare dalvikvm instance from the zygote seems
somewhat pointless since we might as well just execute it directly.

Change-Id: Ib07d822d448e7b431d7564381f9cd11735fd1113
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
23e68780be581a1bb05110f16ad56d1da2bed1e9 16-Jan-2015 Narayan Kamath <narayan@google.com> Fix handling of wrapped processes [part 2]

Drop privileges only if we're root. Zygote.preloadClasses can
be called from a non-root uid / gid in the case of wrapped classes,
so we shouldn't die from the resulting EPERM.

Change-Id: Ie3fbe50a17ec49bcbcb875c3a2ee1e1a3a62e88d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
26b56e628bd77b1e77137b68aecb194791ec6cf6 17-Dec-2014 Elliott Hughes <enh@google.com> Move the remaining ZygoteInit native code over to Java.

Bug: 18719692
Change-Id: I5f9834edecdbcc065a33a9921c740a53441636a4
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
894724be3026c84681cdc902cb62eab6ba646e11 15-Dec-2014 Elliott Hughes <enh@google.com> Rewrite selectReadable JNI in Java.

Bug: 18719692
Change-Id: Id4fa95a31f112c720f7a3ac47a3b6c95c3028438
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dac83f5e6ad494f19a17523e56872e1d0870ee57 15-Dec-2014 Elliott Hughes <enh@google.com> Reimplement reopenStdio in Java.

Bug: 18719692
Change-Id: I4ed984cd6148c5cba75d46a60f32a0687a5bcac3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3fe595108f47fffd73cfc2eb48b71a31e5d606d0 12-Dec-2014 Elliott Hughes <enh@google.com> Lose some unnecessary JNI from the zygote.

Bug: 18719692
Change-Id: Ie2d50400f10f3c54cfbf94e54656f6d704eac267
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
d0c45355b96fb55dd1a79ee06d151ce98d959c23 14-Nov-2014 Ying Wang <wangying@google.com> Move preloaded-classes out of framework.jar.

Instead we install preloaded-classes as a standalone configuration file
/system/etc/preloaded-classes, so we can configure different file per product.

Bug: 18305157
Change-Id: I22f1a1dd44f90268d02532bf18405768523c0b1b
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
05f74b9a6b4985426d94c3e11082c64a931eb69d 22-Sep-2014 Alan Viverette <alanv@google.com> am 2c65386d: am 0dfa4738: Merge "Pass explicit null theme when preloading drawables" into lmp-dev

* commit '2c65386d9bb3d93f39767a284eb3dcc27dd0a2f3':
Pass explicit null theme when preloading drawables
84e001a9f514a047816f27db6ce836966efa481e 22-Sep-2014 Alan Viverette <alanv@google.com> Pass explicit null theme when preloading drawables

Prevents "unresolved theme attributes" warning.

BUG: 17589490
Change-Id: I5217d85b1d5ce8b551315ee8b1ca79eccfac3f10
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
13b99f368229fd7516042dcbbd68bf660bb22d75 12-Sep-2014 Brian Carlstrom <bdc@google.com> am 3b74850d: am 93468f7c: Merge "Add zygote preloading of shared libraries" into lmp-dev

* commit '3b74850dee7e41991794f778eb2f12b43e453a0d':
Add zygote preloading of shared libraries
6c9af96de59ab2feebe3d0165548591c4f632bc5 12-Sep-2014 Brian Carlstrom <bdc@google.com> Add zygote preloading of shared libraries

Bug: 17459019
Change-Id: I7cb4ecd0ec9542aa9079420fe158cedca7fca028
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
629dc1801331ce89e8ee0ff7ee5dcde1d7512417 04-Sep-2014 Anwar Ghuloum <anwarg@google.com> Timing Hacks DO NOT MERGE

Let's submit to see any lingering effects.

Bug: 17310019
Change-Id: I791bceec0b6aa8b80ac4e6c582a10c3f0ec7a906
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
41b07f14135a6ab575d165e89818f7953f3fd7ca 21-Aug-2014 Mathieu Chartier <mathieuc@google.com> am 554bd893: am 8f9ebc8a: Merge "Remove unnecessary explicit GC in ZygoteInit."

* commit '554bd8937b60e8f015f1f46b939dff92c2259790':
Remove unnecessary explicit GC in ZygoteInit.
9a88f10b8996645d7c479df3610c9af1499e741c 20-Aug-2014 Mathieu Chartier <mathieuc@google.com> Remove unnecessary explicit GC in ZygoteInit.

Removes > 1s of GC time and hundreds of GC during device boot.

Zygote size before: 8388608
Zygote size after: 8388608

No increase in zygote space size due to zygote compaction.

Bug: 16398684

Change-Id: I3c6f5a0b26a207ab39bb0a952400d7488e42f00c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
29564cd24589867f653cd22cabbaac6493cfc530 07-Aug-2014 Narayan Kamath <narayan@google.com> Remove system_server classes from the boot image.

We set the system_server classpath in the environment
(like we do with BOOTCLASSPATH). After the zygote forks
the system_server, we dexopt the classpath (if needed)
and then launch the system server with the correct
PathClassLoader. This needed several small / medium
refactorings :

- The logic for connecting to installd is now in a separate
class and belongs in the system_server.
- SystemService / SystemServiceManager have now moved to
classes.jar. They are only used from there, and since they
use Class.forName, we want them to be loaded by the
system_server classloader, and not the bootclassloader.
- BootReceiver now moves to frameworks.jar, because it is
used by ActivityThread and friends.

bug: 16555230

Change-Id: Ic84f0b2baf611eeedff6d123cb7191bb0259e600
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
08cfaf672604422dd355d6703aec78f3aa5ee74e 08-May-2014 Torne (Richard Coles) <torne@google.com> Use the WebView's loader library to load the real library.

Load libwebviewchromiumloader and use it to load the real WebView
library, to enable sharing of the relro segment between different
application processes without requiring that the library be preloaded in
the zygote. A system service is added to track whether the relro segment
file has been prepared, and block loading of the library until it has
been.

Bug: 13005501
Change-Id: I846b37c7b8e2a4eb8a39e4fd455bccbb2048c173
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
be3dc5754fd081f54a86df9894763c0da915eed3 15-May-2014 Narayan Kamath <narayan@google.com> am 402120a2: Merge "Wait for secondary zygote before bringing up the system_server."

* commit '402120a2236b294dff9a51461cb22400a6ef67f6':
Wait for secondary zygote before bringing up the system_server.
64cd907af99ce9702e8975a657ee437c2626f8b5 13-May-2014 Narayan Kamath <narayan@google.com> Wait for secondary zygote before bringing up the system_server.

The zygote that's responsible for starting up the system server
now checks if there's another zygote on the system, and waits
for it to start up. Also, a few minor clean ups :

- Address a long standing TODO about zygote retries.
- Have functions throw IOException where appropriate and
wrap them in ZygoteStartFailedEx with a filled in cause.

bug: 14869939

Change-Id: I9e514659b79b3d2c98a4c5f93c0c376843f6c881
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
9a76e9ba1adbdf7cc431b1e6fe454cf0c5d900de 30-Apr-2014 Bill Yi <byi@google.com> Fix build error

Change-Id: I6f52954a780b747f1ad2a4e429ef192d58c40e76
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
293513a59d36cd96a3e474dde5981380d372d8c9 30-Apr-2014 Bill Yi <byi@google.com> Merge commit '0b62467b142b61ee1e449ba958ba37dfd961ef56' into HEAD
a9569ff70f51a93e134e4d45558884d196b869c3 29-Apr-2014 Elliott Hughes <enh@google.com> Fix two zygote imports.

Change-Id: I5eea2d9f48479c33e1594aaa259274e5e787a1df
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
860c5911a2437ab2543614e138c98553d0d4ebf7 29-Apr-2014 Elliott Hughes <enh@google.com> Move the Zygote off libcore.os and onto android.system.

Change-Id: Iaa20e50b05fad355bdf15bcfdc58efc9941c400c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
49cbafad9beb6041aaee773f75473fdb5022888e 20-Dec-2013 Daniel Leung <daniel.leung@intel.com> Zygote: enable CAP_BLOCK_SUSPEND capability for system server

Starting from kernel 3.6, it requires processes to have the capability
CAP_BLOCK_SUSPEND to set/unset wake locks. Adds CAP_BLOCK_SUSPEND
to the list of capabilities for system server, so that PowerManager
can set wake locks.

Change-Id: I3246e6f6e6cb8f0bedb1c0417ed07085ee1f3aaa
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c41638cb759ce569630ffae4c5c4cdee1b0f3b82 07-Apr-2014 Narayan Kamath <narayan@google.com> Make zygotes aware of their supported ABIs.

Query system properties for the list of ABIs and pass
it as a command line argument to ZygoteInit.

Also add a new Zygote command that returns this list of
ABIs to peers.

Change-Id: I68034c6f63fa626911122579a011a0a25a8cda94
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
973b4663b0b5ee62006522bf4742af076096e548 31-Mar-2014 Narayan Kamath <narayan@google.com> Move zygote startup logic to the frameworks.

The Zygote class is now in com.android.internal.os. It is
responsible for the vast majority of work before and after
the call to fork(). It calls back into the Runtime via
the new dalvik.system.ZygoteHooks class to allow the Runtime
to perform pre fork cleanup and post fork initialization.

The native code in Zygote.cpp is a direct and straightforward
port of the existing code in art. Most differences are
superficial, for example :
- We use C style logging (ALOGE) instead of stream based
logging.
- We call env->FatalError() instead of using LOG(FATAL)

Change-Id: Ia101fb2af12d23894fe57e4134d2bc6d142e5059
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
9eca7f8fbc52ac5b2bf48528b90743f220ffb3ae 07-Mar-2014 Dave Platt <dplatt@google.com> am 53c7608a: am a3c3533b: Merge "Finish fixing Zygote descriptor leakage problem"

* commit '53c7608aefb0ed754394e571cac02e96ad6fcdb3':
Finish fixing Zygote descriptor leakage problem
89d4c897a0e1bc06688bcb1fd39913ece81fe05f 06-Feb-2014 Dave Platt <dplatt@google.com> Finish fixing Zygote descriptor leakage problem

In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID. These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected. The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: indent change

Bug: 12114500
Change-Id: I090402136a8a8b7d6aad6eb153026e85d7cf6ad3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
bd9acc2218fcf3cd6605554a45db2251753ddd7b 07-Jan-2014 Dave Platt <dplatt@google.com> am e966e577: am 02f042dd: Fix socket descriptor leak from Zygote to child app

* commit 'e966e5774ad8d478bc89b541bcac3740fe267d18':
Fix socket descriptor leak from Zygote to child app
02f042ddd9ddf47ef88c4f174eb19a9bee296a45 13-Dec-2013 Dave Platt <dplatt@google.com> Fix socket descriptor leak from Zygote to child app

Due to an API change in LocalSocket, Zygote must now
manually close the FileDescriptor it created when it
registered a LocalServerSocket. The LocalSocket.close()
routine will no longer do so.

Bug: 12114500

(cherry picked from commit 70ef29b04ee4ef7d7acfec79041dbe800961195e)

Change-Id: Ief23a3c99e007dc4aa6f94dfb47a1b2b6c854dad
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dbccd44a638ae8705a5b14bff8b2dd74abc26045 22-Nov-2013 The Android Open Source Project <initial-contribution@android.com> Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD

Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
5c1aa4efa9568d38cd2e8756a274bb30ddd590ba 08-Nov-2013 Elliott Hughes <enh@google.com> am ede7f9d3: am 9e71310d: Merge "Remove incorrect (and unused) capget code."

* commit 'ede7f9d3a39d87f12d58df495f28108784e9b588':
Remove incorrect (and unused) capget code.
42a4bb5730266f80585e67262c73505d0bfffbf8 08-Nov-2013 Elliott Hughes <enh@google.com> Remove incorrect (and unused) capget code.

Note that if you revert this change, the code it removes is incorrect,
and doesn't handle the top 32 bits of capabilities, one of which we're
already using: CAP_BLOCK_SUSPEND.

Bug: 11508244
Change-Id: Ice1f51334bce4941c6d24d6016450a2ebcf92886
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ad13bd5c0d83dd87599dbca11b93cd1ea413006d 04-Nov-2013 Brian Carlstrom <bdc@google.com> Treat UnsatisfiedLinkError as non-fatal

Bug: 11466297

(cherry picked from commit e92f19e58caa05f5f4086d12a6396116ce6182aa)

Change-Id: I449474078b9f465f1da26a27bf96f9c35d2bb2fc
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
e92f19e58caa05f5f4086d12a6396116ce6182aa 04-Nov-2013 Brian Carlstrom <bdc@google.com> Treat UnsatisfiedLinkError as non-fatal

Bug: 11466297
Change-Id: I12be43564da37290b3ee52b1858e44f2229711d9
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6c3baf12e0a6417177793a2e7e95d22721203813 08-Oct-2013 Brian Carlstrom <bdc@google.com> Preload DexCaches

Bug: 11045348
Change-Id: Id27333652d4b3b9ace6c1cdf0566bf39bf0084ed
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
184a0100abc431fc3d6d8dd1b20212b84958cada 11-Jul-2013 Jeff Sharkey <jsharkey@android.com> Allow packages.list access with new GID.

The FUSE daemon is using packages.list to map from package name to
appId after it drops permissions, so create a new "package_info" GID
to grant read access.

Also switches FileUtils to use Libcore.os.

Change-Id: I9451ca4e90e8a985526805c6df0888a244a1db36
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ed96ea2a07ae20c186ad9073d8f0b26419eb35f8 09-May-2013 Romain Guy <romainguy@google.com> Merge "Add the ability to disable OpenGL drivers preloading Bug #8888857"
c5e3638c06f30827cdc6eb0d987adb677e900487 09-May-2013 Romain Guy <romainguy@google.com> Add the ability to disable OpenGL drivers preloading
Bug #8888857

Set ro.zygote.disable_gl_preload to true in the build properties.

Change-Id: Idd93ebb4bbd2861ce60af03ed14819a5cfa70dec
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dad7bd706a4ecca245b4dbe770862874e1854225 09-May-2013 Romain Guy <romainguy@google.com> Merge "Load OpenGL drivers libraries in Zygote"
74c691221b620d74eafff315bf7c8ed8c4b58f3a 09-May-2013 Romain Guy <romainguy@google.com> Load OpenGL drivers libraries in Zygote

This does not initialize EGL/GL.

Change-Id: I951ae0b7defee86eb06821ea807af3e829f4a73c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dbcf2d7482562eff45ac727cea799b37a260e399 18-Apr-2013 Nick Kralevich <nnk@google.com> PowerManagerService: Don't reboot directly.

Instead of calling the reboot system call ourselves, send
a message to init asking it to reboot the system. Init is in
a better position to make sure the system is cleanly shutdown.

Get rid of CAP_SYS_BOOT from system_server.

Bug: 8646621
Change-Id: I200722412844ad8d99e35a442021c6263c3ebc05
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
50289346b3010e24b6a7b86a774d88b81fc28f3b 24-Apr-2013 Alex Klyubin <klyubin@google.com> am a6436526: Merge "Human-readable POSIX capabilities for SystemServer."

* commit 'a643652680486bd1009248d1bd8fcea7da92d661':
Human-readable POSIX capabilities for SystemServer.
48a06e740782184bd126ab743150b474abc9e6a4 19-Apr-2013 Alex Klyubin <klyubin@google.com> Human-readable POSIX capabilities for SystemServer.

Change-Id: I8fecdc55b2cf0041ceed643eb48df53d22ecd600
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
6ad0452e6301c0650f58f3991f7c523f6f279ddb 16-Apr-2013 Jamie Gennis <jgennis@google.com> Disable tracing from Zygote

This change disables all atrace tracing in Zygote immediately after it is
initialized. This is necessary because Zygote has no way to receive
notifications that the enabled trace tags have been changed. Tracing is
re-enabled when other processes fork from Zygote.

Change-Id: If2983858fb0c4890ba9ab041849b1c4d98f66c13
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
cae3d9f0ab2756e3659efc7a08830d2d7b43a05e 30-Jan-2013 Nick Kralevich <nnk@google.com> ZygoteInit: more dead code cleanup

ZYGOTE_FORK_MODE has been set to false since 2009, and the
code indicates that runForkMode() was "retained for reference only."
Remove this dead code. There will always be a reference to this code
in git.

Change-Id: Iddfdca8379fdc6521febea81e553de763b6f4fd0
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
40779e50f04b0d03b49836c640308061f88ff0be 30-Jan-2013 Nick Kralevich <nnk@google.com> Remove dead code.

Setting capabiltities is handled by dalvik. This code
is never called.

Change-Id: I903952c43cf60ea59ec954c9168a7604d05ccaf7
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
80618d66b02d8cce325cdaa184435f43818a062b 20-Aug-2012 Kenny Root <kroot@google.com> am 7d5b22af: am f029c22f: Merge "Use Libcore.os.umask for setting umask"

* commit '7d5b22afae8525cdf80ba1bf8e18b87d597f830d':
Use Libcore.os.umask for setting umask
4c74f8c1713fa82904b10beec4da9ad8ebb97375 17-Aug-2012 Kenny Root <kroot@google.com> Use Libcore.os.umask for setting umask

Libcore.os now provides a umask method call, so just use that since it's
available.

Change-Id: I8826fa40bcab3d61a424ff98a8050d3e44f7ec34
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dde331cebd87982faded6818ad5f9927ff994c96 03-Aug-2012 Dianne Hackborn <hackbod@google.com> We can now (kind-of) change screen density on the fly.

Preloaded drawables now have a density associated with them, so we
can load the correct drawable if we are using a different density.

Window manager now formally keeps track of the density for each
screen, allowing it to be overridden like you can already do with
size, and relies on this density to drive itself internally and
the configurations it reports.

There are a new set of Bitmap constructors where you provide a
DisplayMetrics so they can be constructed with the correct density.
(This will be for when you can have different windows in the same
app running at different densities.)

ActivityThread now watches for density changes, and pushes them
to the DENSITY_DEVICE and Bitmap global density values for that
process.

A new am command allows you to change the density.
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
14577c4df57004131174fbe435031a18f3e7996b 09-Mar-2012 Jeff Brown <jeffbrown@google.com> Should recycle TypedArray.

Change-Id: Ia318de37c22e4533fff631be816cee539a5cd83d
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
dc7bf5d8bff86bed7947806c81a28aff5e9a8c3e 23-Jan-2012 Andy McFadden <fadden@android.com> Don't use bootstrap loader directly

The VM is allowed to use null to represent the bootstrap class
loader, so attempting to call methods on it is a bad idea. Use
the system class loader instead.

Change-Id: I9190848945f679d546d5fb30aba10fd27c7e5404
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
b5d55e302d2253e4bfb233ea705caf258cdc4cb9 11-Aug-2011 Jeff Sharkey <jsharkey@android.com> Foreground/background network stats using sets.

Teach NetworkStats about "counter sets" coming from kernel, and use
them to track usage in foreground/background. Add AID_NET_BW_ACCT to
system_server so it can control counter sets.

Move to composite key of NetworkIdentitySet, UID, set, and tag when
recording historical usage. Persisting still clusters by identity,
since that is heaviest object.

Request async stats poll during systemReady() to bootstrap later
delta calculations. Reset kernel counters when UID removed. Update
various tests.

Bug: 5105592, 5146067
Change-Id: Idabec9e3ffcaf212879821515602ecde0a03de8c
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
e5168930975618a2b2b3f556c6c162a8cf6c9e34 28-Jul-2011 Jeff Sharkey <jsharkey@android.com> Grant AID_NET_BW_STATS to system service.

NetworkManagementService is reading stats /proc/ files, which are now
being protected by GID.

Bug: 5087530
Change-Id: I29b35a97ab621999544b6acc8ad4cf72ee053b79
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
e1dfcb7ab01fb991079ec1f70f75281a0ca9073e 08-Jul-2011 Elliott Hughes <enh@google.com> Pass the targetSdkVersion through to the zygote-forked dalvik.

This will let dalvik implement backwards-compatibile behaviors based on
an app's targetSdkVersion.

Bug: 4772166
Change-Id: I935c5ea9144e8b4e6e21089547287486e2234b7f
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0c2313dc4f4bfaf6aa0506df4c54f25591a9e4c7 11-Jun-2011 Jeff Brown <jeffbrown@google.com> Mimic Zygote preload steps when using wrappers.

Change-Id: I45f182a952920f328d092e5ac86fc0f1c35eb6c1
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ebed7d6e35f7f960e6e6add2b8ab7c7a31a511c3 17-May-2011 Jeff Brown <jeffbrown@google.com> Support wrapping app processes to inject debug instrumentation.
Bug: 4437846

Change-Id: I4552501c693716b14714afb5c5248edaca9547ab
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
ceb889711ff182aa0635f0776fdeeb7185f3a105 08-Apr-2011 Brian Carlstrom <bdc@google.com> Merge "Tolerate missing AccountManager resource, not just missing resource name"
43a17654cf4bfe7f1ec22bd8b7b32daccdf27c09 07-Apr-2011 Joe Onorato <joeo@google.com> Remove the deprecated things from Config.java. These haven't been working since before 1.0.

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
46703b099516c383a6882815bcf9cd4df0ec538d 07-Apr-2011 Brian Carlstrom <bdc@google.com> Tolerate missing AccountManager resource, not just missing resource name

In addition to the primary change in the subject, also some minor cleanup of javadoc, typos, CloseGuard warning, etc found while working on a new AbstractAccountAuthenticator.

Change-Id: I73f3408773a43a0021a15f8d051fd3dbbdf898a5
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
08065b9f09ead8895d97b2971622af8c179e1768 02-Apr-2011 Brian Carlstrom <bdc@google.com> Tracking merge of dalvik-dev to master

git cherry-pick --no-commit a80febd83c8bf0b6717da2a7136179bdc906a5b7

git cherry-pick --no-commit 5e642b41cf44c5da7afdd95ab3d5e2bdbf7b31dd

git cherry-pick --no-commit 4886db14c9eee4b6fee69bd54c57c5af04709c4c

git cherry-pick --no-commit 560c685e448769904047507b9484ce8111967d7e

git cherry-pick --no-commit 63dde7a2fcfa53dc531558635b64cea613d3cdb4

git cherry-pick --no-commit 74e5cb91060a379d98dd3a333b5f231bfb4f502e

git cherry-pick --no-commit 1cc8c9708b555e2e338b7798d38887a2fefcfea6

git cherry-pick --no-commit 09625a21f5abe0c0db15757f58585d552d62c3d7

git cherry-pick --no-commit fcb02dfe0f5a2bb7c07e6d6fc69f756a484b5458

git cherry-pick --no-commit a68cb7fa3ab42854768b8145ff85231663770292

git cherry-pick --no-commit 716beb1c131dd2c6b805d4f681debaa20075010c

git cherry-pick --no-commit 8c29b1097a7afe3a77e27546a56e396f3620a4ec

git cherry-pick --no-commit 9c6a1a55d1c8086c1cc57464eea43725694ff70c

git cherry-pick --no-commit b14f5ea5c57acdd009ba5b51f1bbe430f3d353b8

Change-Id: I8cc94175441b009e23549762d6baee1dbace4881
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f973eaae0841988e9ea8d51a3e28418d03e2be1c 22-Mar-2011 Carl Shapiro <cshapiro@google.com> Remove dead code from the Zygote initialization.

Change-Id: Iad66437d6dae01ab94cfade86f3f7416a2896728
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
b7929d654e2a204dac95225913407deeecaecdd7 08-Dec-2010 Carl Shapiro <cshapiro@google.com> Do not attempt to set the minimize heap size in the Zygote.

This parameter is now specified by the product configuration files.

Change-Id: Ia04e4393b778580c206e3122078c999ac8b326a8
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
091511b41ba1469bea46e9e56cc8e9c0c16c3a6f 27-Oct-2010 Andy McFadden <fadden@android.com> am e3e8642c: am 001c7d12: Merge "Set capabilities sooner." into gingerbread
1b4c7966b15382e9ffb2bfe6468dcef0b6d090b6 27-Oct-2010 Andy McFadden <fadden@android.com> Set capabilities sooner.

Bug 3135433.

Change-Id: I4e34b60c0a01b85ce0d80eb96ff3510604a68c71
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
65202242defad10eb33a3b3277af49eb238a3f33 18-Oct-2010 Romain Guy <romainguy@google.com> am 157fa0ac: am 77c011ba: Set default heap size to 5MB.

Merge commit '157fa0aca55b8e4747f00d2b729e5e361dea7ddb'

* commit '157fa0aca55b8e4747f00d2b729e5e361dea7ddb':
Set default heap size to 5MB.
77c011ba75ee1403c9b7626e4676cd3c8746605b 16-Oct-2010 Romain Guy <romainguy@google.com> Set default heap size to 5MB.

Change-Id: Iac8ae3cbe6b431767776653c9f430983172cfb6f
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
c9ad7c6dbb1d70b831cd79416cbe493ade50ed2c 01-Sep-2010 Brian Carlstrom <bdc@google.com> resolved conflicts for merge of 41e99538 to master

Change-Id: Idddb72e369f127cd74322c3c7385701c2412e343
1751086360056bc60d00f2ed2988bc82be9e7bd9 18-Aug-2010 Brian Carlstrom <bdc@google.com> New Java-based SamplingProfiler

Summary:
- libcore: new Java based SamplingProfiler
- dalvik: remove old SamplingProfiler native bits
- frameworks/base: New placeholder SamplingProfilerIntegration
- vendor/google: remove old profiler snapshot parsing code

Details:

libcore

A new 100% Java SamplingProfiler. While it has more overhead that
the old native one, the new one can actually collect more than the
current PC and frame pointer, so you can get useful context of
where your app is spending time. It currently provides ASCII hprof
format output for use with tools like PerfAnal
dalvik/src/main/java/dalvik/system/SamplingProfiler.java

Unit test for the new SamplingProfiler
dalvik/src/test/java/dalvik/system/SamplingProfilerTest.java

Add core-tests-dalvik
JavaLibrary.mk

dalvik

Removing native code that supported the old SamplingProfiler
vm/Dvm.mk
vm/native/InternalNative.c
vm/native/dalvik_system_SamplingProfiler.c

frameworks/base

Placeholder SamplingProfilerIntegration. Later plans include
generating EventStackTrace protobufs.

New SamplingProfiler does not have a global instance, so
SamplingProfilerIntegration provides one in INSTANCE. Old binary
snapshot format is temporily replaced with ASCII hprof data.
core/java/com/android/internal/os/SamplingProfilerIntegration.java

Simplified interface for zygote profile snapshotting
core/java/com/android/internal/os/ZygoteInit.java

Current SamplingProfilerIntegration does not track event loop
explicitly, but hprof information does include thread information.
core/java/android/app/ActivityThread.java

vendor/google

Removing code for parsing old SamplingProfiler snapshot format
tools/samplingprofiler/Android.mk
tools/samplingprofiler/NOTICE
tools/samplingprofiler/profiler.iml
tools/samplingprofiler/profiler.ipr
tools/samplingprofiler/pull-snapshots.sh
tools/samplingprofiler/sorttable.js
tools/samplingprofiler/src/com/android/profiler/PrintHtml.java
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
90960e87ecae696f73ae18e46c2f003fc3f592cc 06-Aug-2010 Mike Lockwood <lockwood@android.com> Set umask of system server to 0077

This matches the previous behavior of java.io.File file and directory creation.

BUG: 2898660

Change-Id: Ie8978a3fc44abfd22f8046e66742e715354220a8
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3c7c351a6217ac48b741740167c201a679a0ca65 05-Aug-2010 Brian Carlstrom <bdc@google.com> Tracking merge of dalvik-dev to gingerbread

git cherry-pick --no-commit f77cf7f0
git cherry-pick --no-commit c8f503b5285e30c1a881d0ba860ba9021f57d113
git cherry-pick --no-commit 570bb561
git cherry-pick --no-commit e2417541
git cherry-pick --no-commit e4d81f25bd4dc1a5c909b56ab56a56406290da30
git cherry-pick --no-commit 5e8a587d

Change-Id: I101a385d43f3e0f4ce5352217f92ef67a3908c88
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
037a086b164c376d8c428a2a584a3460bf82590f 28-Jul-2010 Mike Lockwood <lockwood@android.com> Give system server permission to access USB.

Change-Id: Id88603a5555b37b437f5333acf78dac3c5ffbce3
Signed-off-by: Mike Lockwood <lockwood@android.com>
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
e2417541b4c1c0954295dd77d6c95512f99a9f91 03-Jun-2010 Jesse Wilson <jessewilson@google.com> Preloaded class list problems shall no longer break the build.

This list is mechanically generated and its a waste of engineering
effort to manually edit this list when a class is deleted or renamed.

Change-Id: Ia8b6ae004678df2c5e2c268742c3a2d7c6a10db3
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
0b3533ae838811d15afb1017144dfbf7c41df4a8 20-Jan-2010 Barry Hayes <bhayes@google.com> Check the boolean value for the arg to ZygoteInit to make sure it's either true or false.
Make a slightly more informative usage message.
Give developers a slightly easier way to have their preloaded classes list out of sync without blowing up.
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
e540833fdff4d58e37c9ba859388e24e2945ed45 05-Sep-2009 Bob Lee <crazybob@crazybob.org> Integrated the profiler into the framework. We run it all the time if the persist.sampling_profiler
system property is set. Saves snapshots to the SD card.
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
45e503ae91d380ebe5158927b7d6aa80e166d096 12-Aug-2009 android-build SharedAccount <android-build@sekiwake.mtv.corp.google.com> resolved conflicts for merge of 802527c6 to master skipping preloaded-classes as pre Bob
2e93f65cab0b4b21a1285b83e985559325e87a3a 11-Aug-2009 Bob Lee <crazybob@google.com> Updated preloaded-classes file.
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
1b2e618bdfe5840f450a6899de548a095739e2ba 10-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 9e09e0f4: Merge change 3724 into donut

Merge commit '9e09e0f439ab30b8856d46827623652d09b7477b'

* commit '9e09e0f439ab30b8856d46827623652d09b7477b':
zygote: Add CAP_SYS_NICE to system server capabilities
1caefa6c40a732dbe75b0782f0aa3147017c38d0 10-Jun-2009 San Mehat <san@google.com> zygote: Add CAP_SYS_NICE to system server capabilities

Signed-off-by: San Mehat <san@google.com>
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
599c918d9794b51992de85b42befa0c71d9ec07f 08-Apr-2009 Andy McFadden <> AI 144931: Added a (hidden) way to "pre-cache" register maps.
The 50 methods that appeared on the GC stacks of the most applications
require 13KB of native heap for their uncompressed register maps, and
the full set took 5ms to uncompress. Pre-computation doesn't represent
a significant improvement in space or time, at the cost of a big pile
of strings in ZygoteInit.
I'm leaving the method in ZygoteInit, but it's not called, and the
static final String[] of method descriptors is empty. We may want to
revisit this later.
BUG=1729570

Automated import of CL 144931
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
076357b8567458d4b6dfdcf839ef751634cd2bfb 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
3dec7d563a2f3e1eb967ce2054a00b6620e3558c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/com/android/internal/os/ZygoteInit.java