public final class Zygote extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEBUG_ALWAYS_JIT
Always use JIT-ed code.
|
static int |
DEBUG_ENABLE_ASSERT
enable Java programming language "assert" statements
|
static int |
DEBUG_ENABLE_CHECKJNI
enable JNI checks
|
static int |
DEBUG_ENABLE_DEBUGGER
enable debugging over JDWP
|
static int |
DEBUG_ENABLE_JNI_LOGGING
Enable logging of third-party JNI activity.
|
static int |
DEBUG_ENABLE_SAFEMODE
disable the AOT compiler and JIT
|
static int |
DEBUG_GENERATE_DEBUG_INFO
Force generation of native debugging information.
|
static int |
DEBUG_NATIVE_DEBUGGABLE
Make the code debuggable with turning off some optimizations.
|
static int |
MOUNT_EXTERNAL_DEFAULT
Default external storage should be mounted.
|
static int |
MOUNT_EXTERNAL_NONE
No external storage should be mounted.
|
static int |
MOUNT_EXTERNAL_READ
Read-only external storage should be mounted.
|
static int |
MOUNT_EXTERNAL_WRITE
Read-write external storage should be mounted.
|
Modifier and Type | Method and Description |
---|---|
static void |
appendQuotedShellArgs(StringBuilder command,
String[] args)
Appends quotes shell arguments to the specified string builder.
|
static void |
execShell(String command)
Executes "/system/bin/sh -c <command>" using the exec() system call.
|
static int |
forkAndSpecialize(int uid,
int gid,
int[] gids,
int debugFlags,
int[][] rlimits,
int mountExternal,
String seInfo,
String niceName,
int[] fdsToClose,
String instructionSet,
String appDataDir)
Forks a new VM instance.
|
static int |
forkSystemServer(int uid,
int gid,
int[] gids,
int debugFlags,
int[][] rlimits,
long permittedCapabilities,
long effectiveCapabilities)
Special method to start the system server process.
|
protected static void |
nativeUnmountStorageOnInit()
Zygote unmount storage space on initializing.
|
public static final int DEBUG_ENABLE_DEBUGGER
public static final int DEBUG_ENABLE_CHECKJNI
public static final int DEBUG_ENABLE_ASSERT
public static final int DEBUG_ENABLE_SAFEMODE
public static final int DEBUG_ENABLE_JNI_LOGGING
public static final int DEBUG_GENERATE_DEBUG_INFO
public static final int DEBUG_ALWAYS_JIT
public static final int DEBUG_NATIVE_DEBUGGABLE
public static final int MOUNT_EXTERNAL_NONE
public static final int MOUNT_EXTERNAL_DEFAULT
public static final int MOUNT_EXTERNAL_READ
public static final int MOUNT_EXTERNAL_WRITE
public static int forkAndSpecialize(int uid, int gid, int[] gids, int debugFlags, int[][] rlimits, int mountExternal, String seInfo, String niceName, int[] fdsToClose, String instructionSet, String appDataDir)
uid
- the UNIX uid that the new process should setuid() to after
fork()ing and and before spawning any threads.gid
- the UNIX gid that the new process should setgid() to after
fork()ing and and before spawning any threads.gids
- null-ok; a list of UNIX gids that the new process should
setgroups() to after fork and before spawning any threads.debugFlags
- bit flags that enable debugging features.rlimits
- null-ok an array of rlimit tuples, with the second
dimension having a length of 3 and representing
(resource, rlim_cur, rlim_max). These are set via the posix
setrlimit(2) call.seInfo
- null-ok a string specifying SELinux information for
the new process.niceName
- null-ok a string specifying the process name.fdsToClose
- an array of ints, holding one or more POSIX
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".instructionSet
- null-ok the instruction set to use.appDataDir
- null-ok the data directory of the app.public static int forkSystemServer(int uid, int gid, int[] gids, int debugFlags, int[][] rlimits, long permittedCapabilities, long effectiveCapabilities)
uid
- the UNIX uid that the new process should setuid() to after
fork()ing and and before spawning any threads.gid
- the UNIX gid that the new process should setgid() to after
fork()ing and and before spawning any threads.gids
- null-ok; a list of UNIX gids that the new process should
setgroups() to after fork and before spawning any threads.debugFlags
- bit flags that enable debugging features.rlimits
- null-ok an array of rlimit tuples, with the second
dimension having a length of 3 and representing
(resource, rlim_cur, rlim_max). These are set via the posix
setrlimit(2) call.permittedCapabilities
- argument for setcap()effectiveCapabilities
- argument for setcap()protected static void nativeUnmountStorageOnInit()
public static void execShell(String command)
command
- The shell command to execute.public static void appendQuotedShellArgs(StringBuilder command, String[] args)
command
- A string builder for the shell command being constructed.args
- An array of argument strings to be quoted and appended to the command.execShell(String)