Commit Graph

6950 Commits

Author SHA1 Message Date
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
Jorim Jaggi
0ea9093df7 Fix crash if drawable doesn't have constant state
am: 92d0602a7c

Change-Id: I8ab088ad588eac8baa674d551201713562d973ef
2016-09-30 09:10:11 +00:00
Jorim Jaggi
92d0602a7c Fix crash if drawable doesn't have constant state
Change-Id: I2364efb9dc1446bc1a8c50abf6bd34a73c226f7e
Fixes: 31755893
2016-09-29 14:37:14 +00:00
Hidenari Koshimae
9820efd269 Increase priority for broadcast intent triggered by HW key am: 469e65e37f
am: ab8a42f7d9

Change-Id: I3891fcfb79919bbf17b937aa8f645cb45d798ce9
2016-09-26 19:40:51 +00:00
Hidenari Koshimae
ab8a42f7d9 Increase priority for broadcast intent triggered by HW key
am: 469e65e37f

Change-Id: I7b2aec06b7d2d0375b2f680e7880ca401684cddd
2016-09-26 19:33:25 +00:00
Hidenari Koshimae
469e65e37f Increase priority for broadcast intent triggered by HW key
Add the FLAG_RECEIVER_FOREGROUND flag to the broadcast intent
triggered by hardware key.
This prevents the framework from delaying the delivery of the
intent to its recipients, and improves the response for hardware
key event under heavy load on the system.

Bug: 28735973
Change-Id: Ib7f219845be34794f4c7545927e53cc6c2b504a3
2016-09-26 18:29:06 +01:00
dongwan0605.kim
d986cfd62d Fix RTL issue of ImageFloatingTextView am: dd8611fc5a
am: 4d590a91c2

Change-Id: I6a563e996bc93dd8f3a53b48c185319fdd1886de
2016-09-23 22:17:33 +00:00
Selim Cinek
10691456b8 Added Emergency affordance feature am: 705442fa7d
am: 0e1f78da65

Change-Id: I6f8220b18bce7889e3b9efe1b075a680a0ae7187
2016-09-23 22:12:33 +00:00
dongwan0605.kim
4d590a91c2 Fix RTL issue of ImageFloatingTextView
am: dd8611fc5a

Change-Id: I101527b922604640fef684c6216b99289ac97f25
2016-09-23 22:04:42 +00:00
Dimitry Ivanov
9e9061f608 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
2016-09-23 15:03:27 -07:00
Selim Cinek
0e1f78da65 Added Emergency affordance feature
am: 705442fa7d

Change-Id: I03ebb84119f9cb310882ba9ea90ee1e1d7118d03
2016-09-23 22:00:42 +00:00