summaryrefslogtreecommitdiffstats
path: root/libcutils
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2012-08-14 21:00:22 -0700
committerJeff Sharkey <jsharkey@android.com>2012-08-15 21:10:07 -0700
commit885342a0f2c834a6b680284047c47c9d04b32565 (patch)
treee595282d0c2054fd0c0206f9390d99424325cb27 /libcutils
parente50ac5f7771872331df70251d23d6bd8155da4a7 (diff)
downloadsystem_core-885342a0f2c834a6b680284047c47c9d04b32565.tar.gz
system_core-885342a0f2c834a6b680284047c47c9d04b32565.tar.bz2
system_core-885342a0f2c834a6b680284047c47c9d04b32565.zip
Multi-user external storage support.
Remount rootfs as recursively shared, so that mount changes are propagated into child namespaces. Mount external storage for access from adb. Clean multi-user dependencies for use in Dalvik. Also define external storage paths. Bug: 6925012 Change-Id: I375de581a63f4f36667894c56a34a9dd45361e8f
Diffstat (limited to 'libcutils')
-rw-r--r--libcutils/Android.mk6
-rw-r--r--libcutils/multiuser.c9
2 files changed, 6 insertions, 9 deletions
diff --git a/libcutils/Android.mk b/libcutils/Android.mk
index 2477d239d..6d525bad6 100644
--- a/libcutils/Android.mk
+++ b/libcutils/Android.mk
@@ -50,7 +50,8 @@ commonSources := \
threads.c \
sched_policy.c \
iosched_policy.c \
- str_parms.c
+ str_parms.c \
+ multiuser.c
commonHostSources := \
ashmem-host.c
@@ -124,8 +125,7 @@ LOCAL_SRC_FILES := $(commonSources) \
mq.c \
partition_utils.c \
qtaguid.c \
- uevent.c \
- multiuser.c
+ uevent.c
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += arch-arm/memset32.S
diff --git a/libcutils/multiuser.c b/libcutils/multiuser.c
index be9304df4..3c86ceecc 100644
--- a/libcutils/multiuser.c
+++ b/libcutils/multiuser.c
@@ -14,19 +14,16 @@
* limitations under the License.
*/
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
#include <cutils/multiuser.h>
-userid_t getUserId(uid_t uid) {
+userid_t multiuser_getUserId(uid_t uid) {
return uid / MULTIUSER_APP_PER_USER_RANGE;
}
-appid_t getAppId(uid_t uid) {
+appid_t multiuser_getAppId(uid_t uid) {
return uid % MULTIUSER_APP_PER_USER_RANGE;
}
-uid_t getUid(userid_t userId, appid_t appId) {
+uid_t multiuser_getUid(userid_t userId, appid_t appId) {
return userId * MULTIUSER_APP_PER_USER_RANGE + (appId % MULTIUSER_APP_PER_USER_RANGE);
}