diff options
author | Jeff Sharkey <jsharkey@android.com> | 2012-08-16 14:32:59 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-16 14:33:00 -0700 |
commit | 2be5338a84f19b24b6515c0bfcf2f3f7b55262c1 (patch) | |
tree | bbe06c96de4f88b1cc484bc33f2e967403fab014 /libcutils | |
parent | edb2d634b35ec1b0268ac7d9ddab8c8fc082a14e (diff) | |
parent | 885342a0f2c834a6b680284047c47c9d04b32565 (diff) | |
download | system_core-2be5338a84f19b24b6515c0bfcf2f3f7b55262c1.zip system_core-2be5338a84f19b24b6515c0bfcf2f3f7b55262c1.tar.gz system_core-2be5338a84f19b24b6515c0bfcf2f3f7b55262c1.tar.bz2 |
Merge "Multi-user external storage support." into jb-mr1-dev
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/Android.mk | 6 | ||||
-rw-r--r-- | libcutils/multiuser.c | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/libcutils/Android.mk b/libcutils/Android.mk index 8684e8f..9791462 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 be9304d..3c86cee 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); } |