Frameworks/base: Add native bridge post-fork initialization
Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
diff --git a/core/java/com/android/internal/os/Zygote.java b/core/java/com/android/internal/os/Zygote.java
index 54c532a..f23326c 100644
--- a/core/java/com/android/internal/os/Zygote.java
+++ b/core/java/com/android/internal/os/Zygote.java
@@ -75,21 +75,25 @@
* file descriptor numbers that are to be closed by the child
* (and replaced by /dev/null) after forking. An integer value
* of -1 in any entry in the array means "ignore this one".
+ * @param instructionSet null-ok the instruction set to use.
*
* @return 0 if this is the child, pid of the child
* if this is the parent, or -1 on error.
*/
public static int forkAndSpecialize(int uid, int gid, int[] gids, int debugFlags,
- int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose) {
+ int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose,
+ String instructionSet) {
VM_HOOKS.preFork();
int pid = nativeForkAndSpecialize(
- uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose);
+ uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName, fdsToClose,
+ instructionSet);
VM_HOOKS.postForkCommon();
return pid;
}
native private static int nativeForkAndSpecialize(int uid, int gid, int[] gids,int debugFlags,
- int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose);
+ int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose,
+ String instructionSet);
/**
* Special method to start the system server process. In addition to the
@@ -126,8 +130,8 @@
native private static int nativeForkSystemServer(int uid, int gid, int[] gids, int debugFlags,
int[][] rlimits, long permittedCapabilities, long effectiveCapabilities);
- private static void callPostForkChildHooks(int debugFlags) {
- VM_HOOKS.postForkChild(debugFlags);
+ private static void callPostForkChildHooks(int debugFlags, String instructionSet) {
+ VM_HOOKS.postForkChild(debugFlags, instructionSet);
}