Move methods where they belong.
Test: m
Test: Device boots
Merged-In: I805c6493078e960ff5b70d84dd93d2da6c7aa797
Change-Id: I805c6493078e960ff5b70d84dd93d2da6c7aa797
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
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)
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
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)
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
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
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
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
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
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
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
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
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
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
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
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
The limit is MAX_WAKELOCKS_PER_UID+1, since OverflowArrayMap
will add one more to contain the overflow.
Change-Id: I53004582daa0c405427308816728f2c1d2bef40d