Code Found In Jelly Bean Reveals Multiple User Accounts Coming Soon to Android

If Android ever hopes to be make the move towards becoming a real desktop OS (this has to be in the back of Google’s mind), it’s going to need one thing first: multiple user accounts. This has long been one of the items at the top of my “Things That Grind My Android Gears” list. Towards the wee hours of last night, we received a tip from our developer friends after a discovery they made, revealed some pretty interesting code hidden deep inside Android 4.1 Jelly Bean AOSP.

What they found were clues that Google has been doing more than just toying around with the idea multiple user accounts on Android, and they’ve actually been busy incorporating code all over the OS that makes its future all but certain. Our developer Steven put together a nice little walk through and if you’re handy with ADB, you can see it for yourself.

Exploring Jelly Bean’s Unfinished Multiple Profile Switching Discovery and Testing Performed by Kevin Barry of TeslaCoil Software.

Commands (using ADB Shell)

pm = PackageManager

am = ActivityManager

 

  • pm create-user test (creates a user, ‘test’ in this example)
  • am switch-user 1 (switches to user ‘1’, which is ‘test’)
  • am switch-user 0 (switches to user ‘0’, which is your original configuration)
  • pm list-users (lists all users on current device)
  • pm remove-user 1 (removes the user ‘1’,which is ‘test’ in this example.  Note that create-user takes a string name while remove-user takes an integer)


Things To Note:

  • App settings are in /data/user/0/ with /data/data symlinked to it for backwards compatibility
  • Some system settings are in /data/system/users/0/ rather than just /data/system/
  • You can view 2011 commit messages in AOSP for all of these commands
  • Visually you can not determine what user is currently active.
  • Notifications and recent apps do not clear (remember… unfinished) and causes confusion to what user you’re on and will switch to whatever user that is running that particular app you click on.
  • Static wallpapers do not switch per user (seems to be shared) but live wallpapers do switch with each user.
  • Encrypted apps, which is all paid apps from the Play Store in Jellybean, will FC between users.  For example: if you run a paid app from one user on a different user that did not originally install the app, you will get the following error: “E/AndroidRuntime( 8707): Caused by: java.lang.ClassNotFoundException: com.levelup.beautifulwidgets.BeautifulWidgets”
  • Apps all have different settings which allows you to login or have different settings per user.  (even gmail)

Example Shell (ADB):

shell@android:/ # pm list-users

Users:

UserInfo{0:Primary:3}

UserInfo{1:test:0}

Pretty amazing find, right? The boys at Android Police made a similar discovery, giving a timeline of commits pushed to AOSP dating as far back as April 14th, 2011, all the way to March 28th, 2012. This shows Google has been working on UA’s for awhile now. All the pieces are in place. Multiple user accounts are coming to Android. The question is no longer if — but when. Excited?

Continue reading: