Commit Graph

6960 Commits

Author SHA1 Message Date
Treehugger Robot
851afe56b8 Merge "Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit" 2017-02-10 00:45:56 +00:00
Andreas Gampe
4e66db8d0c Framework: Clean up RuntimeInit/ZygoteInit/WrapperInit
Move methods where they belong.

Test: m
Test: Device boots
Merged-In: I805c6493078e960ff5b70d84dd93d2da6c7aa797
Change-Id: I805c6493078e960ff5b70d84dd93d2da6c7aa797
2017-02-09 13:16:17 -08:00
Paul Duffin
57e490cf8c Partial Revert "Replace com.android.internal.util.Predicate with java.util.function.Predicate"
This partially reverts commit 3e5fbca0c5.

Bug: 35187548
Bug: 30188076
Bug: 35089332
Test: make checkbuild
Change-Id: I7ab4279aab604e3d56003b0a59867948aebabd28
2017-02-09 14:52:43 +00:00
Paul Duffin
78a20be77a Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" 2017-02-08 18:06:08 +00:00
Paul Duffin
b5c09b5487 Fix problem with JavaDoc
Test: make checkbuild
Change-Id: Ia321e0a57ff63aa62adee16d611c063a22807176
2017-02-08 09:16:18 +00:00
Paul Duffin
3e5fbca0c5 Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Merged-In: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
Change-Id: I58e4e35e7b7315033d893748f7c79e1ba6732f39
2017-02-07 16:57:54 +00:00
Paul Lawrence
ef85477470 Install seccomp into zygote not init
Bug: 34710876
Test: Boots, correct size filter installed, blocks unallowed calls

Change-Id: I3e66e8724ace37f7d30451b98a5e574766252ea0
2017-02-02 17:45:11 +00:00
Nicolas Geoffray
347b1df988 Introduce DEBUG_JAVA_DEBUGGABLE.
For notifying ART it will run a debuggable app.

Also rename ENABLE_DEBUGGER to ENABLE_JDWP.

Test: builds and runs
bug: 28769520
Change-Id: Ic096a176edfd5bf0bbe92b8367fbaa687a07d284
2017-01-27 11:26:53 -08:00
John Reck
ed065024a5 Fix a bunch of repeated reads of a ro.* property
SystemProperties.get() is not particularly fast,
especially if a string is returned. Since ro.* values
are unable to be changed, there's no need to
continously re-query them. Cache the value at
static init time to trivially fix this.

Test: refactoring CL.
Change-Id: Iccb021d3cb2ba3a4a1d0048ddec6811bb7409eec
(cherry picked from commit aa67f684ff)
2017-01-27 11:04:39 -08:00
Andreas Gampe
8dfa178efb Zygote: Add fdsToIgnore
Add file descriptors that should be ignored in the file descriptor
table check.

Use this to ignore the pipe file descriptors when starting an app
with invoke-with (wrapper).

Bug: 32607405
Test: m
Test: Device boots
Test: Apps start
Test: adb root && adb shell setprop wrap.com.android.calculator2 logwrapper && adb shell am start -S -n com.android.calculator2/.Calculator
Change-Id: I4a30dfc9382d3172cc815bd41b17a123799354f6
2017-01-10 16:55:34 -08:00
Robert Sesek
54e387ddbe Dynamically add the webview_zygote's preloaded APK to the zygote FD whitelist.
This refactors the whitelist to be a class, rather than just a static C array.
The whitelist can then be augmented dynamically when the package path is known
in the webview_zygote.

Test: m
Test: sailfish boots
Test: Enable Multi-process WebView in developer options, perform a search in GSA.

Bug: 21643067
Change-Id: Ia1f2535c7275b42b309631b4fe7859c30cbf7309
(cherry picked from commit 061ee3088a)
2017-01-10 11:44:56 -08:00
Tamas Berghammer
0ca16fa584 Enable logwrapper functionality on user builds
When an app is debuggable, check whether a script called "wrap.sh" exists
in the app's native library directory. If so, start the app using the
invoke-with functionality over the script. Weaken the invoke-with check
on the zygote side to allow the functionality for debuggable apps.

The goal of the functionality is to make malloc debug, strace and other
similar tools available for NDK based application developers.

Bug: 33668201
Test: manual - debug malloc can be enabled using the new feature
Change-Id: Ia4bec0854cf4dc08446f1671494200f54ef366ee
2016-12-16 09:03:06 -08:00
Treehugger Robot
c0cc7c646c Merge "Install all files from the lib directory for debuggable apps" 2016-12-16 00:35:55 +00:00
Jeff Sharkey
740f523b25 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
2016-12-09 15:30:34 -07:00
Jeff Sharkey
d7b144a5e9 Merge "Prepare to move dexopt calls to Binder." 2016-12-09 16:42:25 +00:00
Hugo Benichi
05ad47add8 DO NOT MERGE: TokenBucket for rate-limiting and throttling
This patch adds a TokenBucket class that can accumulate and distribute
tokens over time.

Test: comes with unit tests.
Bug: 32198637

(cherry picked from commit 998493f0ee)

Change-Id: I4012ae6d02f7004bceee9a2ba03914f2a2506031
2016-12-09 11:21:29 +09:00
Jeff Sharkey
c98c7bccdc 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
2016-12-08 09:11:50 -07:00
Jeff Sharkey
ba6f8c8bef Move dump() to dumpAsync(), more oneway calls.
When calling out to dump services hosted by external apps, use
dumpAsync() to avoid hanging if the remote process is wedged.

(cherry picked from commit 850c83e6da)

Test: builds, boots, runs with minimal logs triggered
Bug: 32715088

Merged-In: I70aa2666ae21dae8f09ded2063bed359c0b210c5

Change-Id: Ic2be10dc8478d613cea6e2c976b9987c250b86b7
2016-12-07 12:24:21 -08:00
Hall Liu
01106c45ca Merge "Add removeState method to StateMachine"
am: 0310de1136

Change-Id: Ib7d8e435c76bc7bcd83d6350c3c0622bb44d6552
2016-11-28 20:58:43 +00:00
Hall Liu
b222d2045d Add removeState method to StateMachine
Method to be used by BluetoothRouteManager in Telecom.

Test: unit tests in Telecom
Change-Id: Icdd1a3d42224246a5f26100fabb26313ce83b14c
2016-11-23 11:52:58 -08:00
Torne (Richard Coles)
1feb782f01 Merge "Precreate the classloader for the WebView."
am: 566b1c80e4

Change-Id: Ic79079748dae515cb8d89ef99148755ac65f1d47
2016-11-21 17:04:22 +00:00
Torne (Richard Coles)
3b6ca99b10 Precreate the classloader for the WebView.
We want to create the classloader for the WebView in advance in the
zygote so that it can preload Java and native code for its children, but
the zygote can't talk to the package manager (so doesn't have a
PackageInfo for the APK) and also doesn't have an ActivityThread, so
constructing a LoadedApk is difficult.

Instead, we use the fact that ApplicationLoaders contains a
process-global cache of classloaders for APKs, and prepopulate a cache
entry without constructing a LoadedApk. This requires making
ApplicationLoaders public. To calculate the correct library paths from
the information the zygote has, we reuse the logic in LoadedApk (which
is already public, and just needs a small change to allow a null
ActivityThread when checking for instrumentation).

The other parameters for classloader creation (target SDK, bundled app,
etc) are hardcoded to usable values for the WebView's case. WebView
never needs to use any system libraries that aren't public so claiming
it's not bundled is fine even when that isn't actually true, and WebView
will always target the current platform API level.

Once the classloader is created, look up the factory class and call
preloadInZygote on it to give it a chance to preload the native library
and do other shared initialisation.

Bug: 21643067
Test: enable multiprocess WebView, examine librank output to see sharing
Change-Id: I696ead637e3f7382bcc58cfaf61eac5921862015
2016-11-21 15:04:13 +00:00
Tamas Berghammer
d6dd6b8a61 Install all files from the lib directory for debuggable apps
This is required to support developer tools what want to install helper
code (e.g. scripts, executables) into the apps lib directory.

Test: manual - install debuggable & non-debuggable app
Change-Id: Ibceb827f92a09735d7c605e689e23c0cd293a6fd
2016-11-09 23:50:49 +00:00
Andreas Gampe
fdfc79a878 Merge "Zygote: Avoid string concatentation for systrace"
am: 8bcd159234

Change-Id: I484e5a56b790f57d097970f727959438debafafb
2016-11-01 17:19:44 +00:00
Andreas Gampe
c425362049 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
2016-10-28 18:19:30 -07:00
Robert Sesek
f80fab010a Merge "Create the WebViewZygote and implement WebViewZygoteInit."
am: 8be2850546

Change-Id: I608ea53be52cb91f0e8cf73998de4578b39e099a
2016-10-22 03:12:18 +00:00
Treehugger Robot
8be2850546 Merge "Create the WebViewZygote and implement WebViewZygoteInit." 2016-10-22 03:03:10 +00:00
Christopher Wiley
5f9fedc5d7 Merge "IndexOutOfBoundsException observed in ProcessStats" am: 6408e2e5cc am: eedd2b529d
am: 53d12379f4

Change-Id: I4bcde8dde8c3bad7754e26dd56f8321032daa5a3
2016-10-14 14:21:39 +00:00
Robert Sesek
aa3c463a5b resolve merge conflicts of 0b58f19 to nyc-mr1-dev-plus-aosp
Change-Id: I374d842cab49b58b570d5ad7ef3dffb7b148d236
2016-10-13 16:49:47 -04:00
Christopher Wiley
53d12379f4 Merge "IndexOutOfBoundsException observed in ProcessStats" am: 6408e2e5cc
am: eedd2b529d

Change-Id: Ica176cd4b1bf569dfa03bdcefac622deddb57eca
2016-10-13 14:22:08 +00:00
Robert Sesek
d414158f79 resolve merge conflicts of 7031dac to nyc-mr1-dev-plus-aosp
Change-Id: I71fbde71dd97abab77f798b621972fb1d26af799
2016-10-12 15:03:19 -04:00
Christopher Wiley
eedd2b529d Merge "IndexOutOfBoundsException observed in ProcessStats"
am: 6408e2e5cc

Change-Id: I54ad3ac5a5e37371d787f4fee09fd8d73787665d
2016-10-10 22:41:23 +00:00
Robert Sesek
0b58f198df resolve merge conflicts of 8f8d187 to nyc-dev-plus-aosp
Change-Id: I75c7110ee4f0c9717e7276b609caa2402ef5c2be
2016-10-10 18:34:42 -04:00
Christopher Wiley
6408e2e5cc Merge "IndexOutOfBoundsException observed in ProcessStats" 2016-10-10 22:31:33 +00:00
Tobias Sargeant
7031dacaf5 Refactor ZygoteInit to support a WebView-specific zygote.
am: dd4bb31639

Change-Id: Ie61bf8517c5b7a20beb67259d84e351f4a47665b
2016-10-10 21:12:49 +00:00
Selim Cinek
e0c3c660a7 DO NOT MERGE - Added Emergency affordance feature
Added a service that listens whether emergency affordances
are necessary.

If the they are needed, it adds an option to the
global actions dialog that directly launches the
emergency call and also adds a long-press listener
to the keyguard emergency button.

Test: adb shell settings put global force_emergency_affordance 1 && adb shell settings put global emergency_affordance_number 111112
Bug: 30404490
Change-Id: Ib96a15da2ef4b568a8d77140ebca6aa6f20f5ddb
2016-10-10 18:58:23 +00:00
pengzhicai
5c6740a30c IndexOutOfBoundsException observed in ProcessStats
When the process dead, IndexOutOfBoundsException observed in ProcessStats
https://code.google.com/p/android/issues/detail?id=223791&thanks=223791&ts=1474967996

Change-Id: Idbe4adf060c6898e838b5eaeecf476ba6c3e586d
Signed-off-by: pengzhicai <pengzhicai@xiaomi.com>
2016-10-09 12:37:30 +00:00
Robert Sesek
8f8d187a78 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 94e824bc1b)
(cherry picked from commit 96b49848e7)

Change-Id: I2e12057e4c2e7567f909d699b487e70b1664cca8
2016-10-07 14:25:36 -07:00
Tobias Sargeant
dd4bb31639 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 ba816e0c9e)
(cherry picked from commit b9679dc1fa)

Change-Id: Iefdb0784dd08ac09a23aafe18663c13dce421775
2016-10-07 14:25:20 -07:00
Nancy Zheng
ce2cef46b3 Fix race condition in checkPattern and verifyPattern.
am: 9475460e66

Change-Id: I88a9304c1f7d23b70cb23988112fc6c34db51338
2016-10-07 18:00:24 +00:00
Nancy Zheng
9475460e66 Fix race condition in checkPattern and verifyPattern.
Bug: 31939282
Change-Id: I3250ab900f190ca9c820ac355ce94a699315b137
2016-10-07 10:41:00 -07:00
Robert Sesek
ded2098436 Create the WebViewZygote and implement WebViewZygoteInit.
This adds a new init-spawned daemon, webview_zygote, that starts a JVM and
acts as a zygote process for WebView isolated_app services.

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

Bug: 21643067
Change-Id: Ida98bd04b4d77736b672b03af651c4eb97ce88c1
2016-10-07 12:38:04 -04:00
Dimitry Ivanov
629ad7e37e Merge "Relax namespace restriction on system server classloader" am: a8135325c1 am: 3c6b4961cb
am: 097ff24545

Change-Id: I9fcc4eeb399da4bdfef2a415e175f2a59f332c84
2016-10-07 09:00:19 +00:00
Dimitry Ivanov
097ff24545 Merge "Relax namespace restriction on system server classloader" am: a8135325c1
am: 3c6b4961cb

Change-Id: I60ab1b74e82a11da485e30a7ea5e45e49c5498c9
2016-10-07 08:53:06 +00:00
Dimitry Ivanov
3c6b4961cb Merge "Relax namespace restriction on system server classloader"
am: a8135325c1

Change-Id: Ie6b5e9041c1a03a8a6b2343069ef2a37b9aba9aa
2016-10-07 08:45:18 +00:00
Dimitry Ivanov
a8135325c1 Merge "Relax namespace restriction on system server classloader" 2016-10-07 08:34:41 +00:00
Dianne Hackborn
a89e1ec692 Fix issue #31305336: File corrupt: too many wake locks 101 am: cb99a72e62
am: 50b9f3513c

Change-Id: Idfc3a5413248ac0b74f88d21a9f1f4f642b3f73c
2016-10-06 21:27:35 +00:00
Dianne Hackborn
50b9f3513c Fix issue #31305336: File corrupt: too many wake locks 101
am: cb99a72e62

Change-Id: I01062999e2a1207c5d1bc826e8c9372c0fb012f7
2016-10-06 20:58:54 +00:00
Dianne Hackborn
cb99a72e62 Fix issue #31305336: File corrupt: too many wake locks 101
The limit is MAX_WAKELOCKS_PER_UID+1, since OverflowArrayMap
will add one more to contain the overflow.

Change-Id: I53004582daa0c405427308816728f2c1d2bef40d
2016-10-03 17:00:02 -07:00
Jorim Jaggi
38afe3a0c0 Fix crash if drawable doesn't have constant state am: 92d0602a7c
am: 0ea9093df7

Change-Id: Idee382b4a6adb2322ce9d62c4f672e2b0c1d6191
2016-09-30 09:19:03 +00:00