I am not sure how many of you are aware of this feature, but AOSP effectively implements multi user support for Android. I found out it is in AOSP a couple of weeks ago (a bit
after implementing it myself unfortunately...), and although it must have some flaws it seems to work very nicely. Separate /data/... , Separate ContentProviders, user aware ActivityStack etc. Just root your device / emulator, "pm
create-user" "am switch-user" and you got yourself separate profiles.
Are you guys at Linaro aware of this feature? If so, I would be glad to further discuss it and this mailing list seems like a good place to do that, following the interesting "Android vs. Linux" discussions in VC #6 and #8.
Google doesn't mention anything about
it and there's no point in discussing it in "android-platform" as
the google guys will probably address this subject only when released.
For those who don't know this feature, here is a trivial working usage example of what I'm talking about, with some explanations of how stuff works.. Would work for any current master branch build:
# t=0: No users. # The good old /data/data package install hierarchy is used as is (well actually /data/user/0 is a # symlink to that.)
# t=1: Create users - Now the PackageManager actually installs the packages in /data/user/<number>/com.bla.blabla.app
adb -e shell pm create-user ClarkKent # Added user Primary at id=0 and ClarkKent at id=1 adb
-e shell pm create-user Superman # Added user Superman at id=2 .
Superman can fly, lift heavy weight, shoot laser beams off his eyes -
but he is not a super user/ "system" user.
# t=2+ switch users. from the little I experimented with it works nice - Just avoid the "primary" user. adb -e shell am switch-user 2 adb -e shell am switch-user 1
# ps output would yield a uX_aY entry for each app as long as it's not owned by root/system, where X is the user id, and Y an "old" uid for each app.