OSDN Git Service

Include user identifier in external storage paths.
authorJeff Sharkey <jsharkey@android.com>
Sat, 8 Sep 2012 05:58:13 +0000 (22:58 -0700)
committerJeff Sharkey <jsharkey@android.com>
Sat, 8 Sep 2012 06:15:40 +0000 (23:15 -0700)
commitd8de46c475830792eeb6fb0f7b59aab51f55e817
tree9fcda4434703ff4cc73dc355d69ba5186275c457
parent21c93dc795dfbea3932e0273b1aa873051dde72c
Include user identifier in external storage paths.

When building external storage paths, always include user in path
to enable cross-user paths and aid debugging.

Each Zygote process continues to only have access to the appropriate
user-specific emulated storage through bind mounts. A second set of
mounts continue supporting legacy /sdcard-style paths. For example,
a process running as owner has these mount points:

/storage/emulated_legacy
/storage/emulated_legacy/Android/obb
/storage/emulated/0
/storage/emulated/obb

This change also creates two nested namespaces around zygote. The
first namespace is created when the zygote starts, and it holds a
single writable tmpfs, since rootfs is ro. The second namespace is
created quickly after forking, and is used to hold the private
user-specific bind mounts. (This design saves us from creating a
tmpfs-per-process.)

Bug: 7131382
Change-Id: Id80403ec956f0bff6997411cb1f82f273c76b85f
vm/Init.cpp
vm/native/dalvik_system_Zygote.cpp