diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-08-16 15:20:03 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2012-08-16 15:20:03 -0700 |
commit | 1d7a4a8f05b12e365e898a4c7639e285118643b8 (patch) | |
tree | 16fc7ca397d3e2a4c233bd9e967efe455e326818 /dalvik | |
parent | 1a3437b67847aa34d2c0679b50c0176b6295adc9 (diff) | |
download | libcore-1d7a4a8f05b12e365e898a4c7639e285118643b8.zip libcore-1d7a4a8f05b12e365e898a4c7639e285118643b8.tar.gz libcore-1d7a4a8f05b12e365e898a4c7639e285118643b8.tar.bz2 |
Multi-user external storage support.
Add flags for mounting external storage and pass into JNI.
Bug: 6925012
Change-Id: I3704ef1616339f9f5f854f734b58efa7a02b67a4
Diffstat (limited to 'dalvik')
-rw-r--r-- | dalvik/src/main/java/dalvik/system/Zygote.java | 55 |
1 files changed, 19 insertions, 36 deletions
diff --git a/dalvik/src/main/java/dalvik/system/Zygote.java b/dalvik/src/main/java/dalvik/system/Zygote.java index ec114ed..a649025 100644 --- a/dalvik/src/main/java/dalvik/system/Zygote.java +++ b/dalvik/src/main/java/dalvik/system/Zygote.java @@ -41,6 +41,13 @@ public class Zygote { /** Enable logging of third-party JNI activity. */ public static final int DEBUG_ENABLE_JNI_LOGGING = 1 << 4; + /** No external storage should be mounted. */ + public static final int MOUNT_EXTERNAL_NONE = 0; + /** Single-user external storage should be mounted. */ + public static final int MOUNT_EXTERNAL_SINGLEUSER = 1; + /** Multi-user external storage should be mounted. */ + public static final int MOUNT_EXTERNAL_MULTIUSER = 2; + /** * When set by the system server, all subsequent apps will be launched in * VM safe mode. @@ -114,27 +121,17 @@ public class Zygote { * @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, String seInfo, String niceName) { + public static int forkAndSpecialize(int uid, int gid, int[] gids, int debugFlags, + int[][] rlimits, int mountExternal, String seInfo, String niceName) { preFork(); - int pid = nativeForkAndSpecialize(uid, gid, gids, debugFlags, rlimits, seInfo, niceName); + int pid = nativeForkAndSpecialize( + uid, gid, gids, debugFlags, rlimits, mountExternal, seInfo, niceName); postFork(); return pid; } - native public static int nativeForkAndSpecialize(int uid, int gid, - int[] gids, int debugFlags, int[][] rlimits, String seInfo, String niceName); - - /** - * Forks a new VM instance. - * @deprecated use {@link Zygote#forkAndSpecialize(int, int, int[], int, int[][])} - */ - @Deprecated - public static int forkAndSpecialize(int uid, int gid, int[] gids, - boolean enableDebugger, int[][] rlimits) { - int debugFlags = enableDebugger ? DEBUG_ENABLE_DEBUGGER : 0; - return forkAndSpecialize(uid, gid, gids, debugFlags, rlimits, null, null); - } + native public static int nativeForkAndSpecialize(int uid, int gid, int[] gids, int debugFlags, + int[][] rlimits, int mountExternal, String seInfo, String niceName); /** * Special method to start the system server process. In addition to the @@ -159,31 +156,17 @@ public class Zygote { * @return 0 if this is the child, pid of the child * if this is the parent, or -1 on error. */ - public static int forkSystemServer(int uid, int gid, int[] gids, - int debugFlags, int[][] rlimits, - long permittedCapabilities, long effectiveCapabilities) { + public static int forkSystemServer(int uid, int gid, int[] gids, int debugFlags, + int[][] rlimits, long permittedCapabilities, long effectiveCapabilities) { preFork(); - int pid = nativeForkSystemServer(uid, gid, gids, debugFlags, rlimits, - permittedCapabilities, - effectiveCapabilities); + int pid = nativeForkSystemServer( + uid, gid, gids, debugFlags, rlimits, permittedCapabilities, effectiveCapabilities); postFork(); return pid; } - /** - * Special method to start the system server process. - * @deprecated use {@link Zygote#forkSystemServer(int, int, int[], int, int[][])} - */ - @Deprecated - public static int forkSystemServer(int uid, int gid, int[] gids, - boolean enableDebugger, int[][] rlimits) { - int debugFlags = enableDebugger ? DEBUG_ENABLE_DEBUGGER : 0; - return forkAndSpecialize(uid, gid, gids, debugFlags, rlimits, null, null); - } - - native public static int nativeForkSystemServer(int uid, int gid, - int[] gids, int debugFlags, int[][] rlimits, - long permittedCapabilities, long effectiveCapabilities); + native public static int nativeForkSystemServer(int uid, int gid, int[] gids, int debugFlags, + int[][] rlimits, long permittedCapabilities, long effectiveCapabilities); /** * Executes "/system/bin/sh -c <command>" using the exec() system call. |