diff options
author | jgu21 <jinghui.gu@intel.com> | 2014-09-10 06:55:07 -0400 |
---|---|---|
committer | Andreas Gampe <agampe@google.com> | 2014-09-28 15:35:59 -0700 |
commit | 208678718f9f8db3bc279c7d5bd1445af2831ae3 (patch) | |
tree | b194dd88578c4c753c3359f67d3d13c11b52d40e /core/java/android/os | |
parent | 8120652bb1155d762d945c1a3bf1636b6825dbd2 (diff) | |
download | frameworks_base-208678718f9f8db3bc279c7d5bd1445af2831ae3.zip frameworks_base-208678718f9f8db3bc279c7d5bd1445af2831ae3.tar.gz frameworks_base-208678718f9f8db3bc279c7d5bd1445af2831ae3.tar.bz2 |
Frameworks/base: Early init native bridge
Add the app directory to the arguments for starting a process.
Add a check for NeedsNativeBridge and a call to PreInitializeBridge
in the native fork code.
(cherry picked from commit 2eacd06bfb82b33dfcbccafbcfc0bf1218484bb5)
Bug: 17671501
Change-Id: I970db5b284b0c12e2d8a45df3950c1fff2927a4e
Diffstat (limited to 'core/java/android/os')
-rw-r--r-- | core/java/android/os/Process.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/java/android/os/Process.java b/core/java/android/os/Process.java index b2ebc31..3ada9bb 100644 --- a/core/java/android/os/Process.java +++ b/core/java/android/os/Process.java @@ -469,6 +469,7 @@ public class Process { * @param seInfo null-ok SELinux information for the new process. * @param abi non-null the ABI this app should be started with. * @param instructionSet null-ok the instruction set to use. + * @param appDataDir null-ok the data directory of the app. * @param zygoteArgs Additional arguments to supply to the zygote process. * * @return An object that describes the result of the attempt to start the process. @@ -484,11 +485,12 @@ public class Process { String seInfo, String abi, String instructionSet, + String appDataDir, String[] zygoteArgs) { try { return startViaZygote(processClass, niceName, uid, gid, gids, debugFlags, mountExternal, targetSdkVersion, seInfo, - abi, instructionSet, zygoteArgs); + abi, instructionSet, appDataDir, zygoteArgs); } catch (ZygoteStartFailedEx ex) { Log.e(LOG_TAG, "Starting VM process through Zygote failed"); @@ -592,6 +594,7 @@ public class Process { * @param seInfo null-ok SELinux information for the new process. * @param abi the ABI the process should use. * @param instructionSet null-ok the instruction set to use. + * @param appDataDir null-ok the data directory of the app. * @param extraArgs Additional arguments to supply to the zygote process. * @return An object that describes the result of the attempt to start the process. * @throws ZygoteStartFailedEx if process start failed for any reason @@ -605,6 +608,7 @@ public class Process { String seInfo, String abi, String instructionSet, + String appDataDir, String[] extraArgs) throws ZygoteStartFailedEx { synchronized(Process.class) { @@ -668,6 +672,10 @@ public class Process { argsForZygote.add("--instruction-set=" + instructionSet); } + if (appDataDir != null) { + argsForZygote.add("--app-data-dir=" + appDataDir); + } + argsForZygote.add(processClass); if (extraArgs != null) { |