Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,731,492 Members 52,516 Now Online
XDA Developers Android and Mobile Development Forum

[MOD] Add multi-user support to Android 4.2 roms using device overlay (phone)

Tip us?
 
rogro82
Old
(Last edited by rogro82; 3rd December 2012 at 03:06 PM.)
#1  
rogro82's Avatar
Senior Recognized Developer - OP
Thanks Meter 440
Posts: 862
Join Date: May 2008

 
DONATE TO ME
Default [MOD] Add multi-user support to Android 4.2 roms using device overlay (phone)

I dont know if this has already been posted, but I could not find anything that enabled multi-user support directly.

It is fairly simple to add multi-user support to your Android 4.2 rom using the device overlay.

To enable multi-user support you will have to add the following to your config.xml:
<integer name="config_multiuserMaximumUsers">8</integer>

This will enable the Users section in Settings to add/remove new users.

Additionally you will have to modify layout-port/keyguard_host_view.xml, because the layout-port version of keyguard_host_view.xml does not have the multi-user selector.

You will need to add the following to the layout:
<include layout="@layout/keyguard_multi_user_selector"/>

Instead of modifying the layout xml directly you can also just add a modified version of the .xml to your device overlay.

That will add the user selector to the keyguard/lockscreen.

The changes can be found here:
https://github.com/adrian-bl-hox-jb/...ac8617cc9abc9f



In case there is just one user it will not show the user selector in the keyguard/lockscreen.

Known issues:

* The dialer only works in the main user and and trying to dial in any other user will result in a crash, because the dialer does not support multi-user yet.
Google+ | Twitter | GitHub

Most recent devices
Samsung Galaxy Note | Samsung Galaxy Nexus | HTC OneX | Sony NSZ-GS7

Notice: I do not respond to tech support questions through PM.
The Following 7 Users Say Thank You to rogro82 For This Useful Post: [ Click to Expand ]
 
broodplank1337
Old
#2  
broodplank1337's Avatar
Recognized Contributor / Recognized Developer
Thanks Meter 9884
Posts: 4,921
Join Date: Nov 2011
Location: Nijmegen

 
DONATE TO ME
Cool, thanks for sharing! (Although, I think having more users on an android device is kinda useless, but very nice that its possible)
Device: Samsung Galaxy S4 (i9505)

Latest Development:
 

Roms:
AOSP v4.4.4 (KTU84P) from source for I9505 (Github)
- Cleanest ROM available for i9505. along with up-to-date stock kernel, also forms a perfect base for ROM developers.

Apps:
Galaxy S4 Glove Mode App (Playstore link)
- Do you want the Glove Mode of the S4 but your ROM doesn't support it? Use this app to enable/disable it easily.

Latest Scraps:
Proprietary Lib Cleaner / Silent proprietary libs / Live Thermal Monitor / GIT Conflict Fixer

Projects in development:
 

broodROM KitKat "Aiming for perfection"
- Custom ROM with really high standards, more info soon

For sources you can visit my Github. Or take a look at all my projects

The Following User Says Thank You to broodplank1337 For This Useful Post: [ Click to Expand ]
 
lokeshsaini94
Old
#3  
lokeshsaini94's Avatar
Recognized Contributor / Themer
Thanks Meter 3614
Posts: 1,775
Join Date: May 2012
Location: Behind you!!!

 
DONATE TO ME
This can be usefull when you have others Using your phone then you can set password for main acc and when others ask your phone they can open guest account or other...
this will get better...

Sent from my GT-S7500 using xda premium

lokeshsaini94's Theming Hub
MY WORK <= click here
TEAM GFX BANDITS - you request, we design.
I WON'T REPLY TO ANY DEVELOPMENT RELATED QUESTIONS WITH PM...
The Following User Says Thank You to lokeshsaini94 For This Useful Post: [ Click to Expand ]
 
rogro82
Old
#4  
rogro82's Avatar
Senior Recognized Developer - OP
Thanks Meter 440
Posts: 862
Join Date: May 2008

 
DONATE TO ME
Quote:
Originally Posted by broodplank1337 View Post
Cool, thanks for sharing! (Although, I think having more users on an android device is kinda useless, but very nice that its possible)
I used to agree about it being useless for phones, but I also share a family gmail account and I like having that completely seperated from my own user so that I don't have calendars etc mixed in one user.

And in case you only have one user everything is the same as without the multiple user ability so it kinda made sense just adding it and let the user decide.
Google+ | Twitter | GitHub

Most recent devices
Samsung Galaxy Note | Samsung Galaxy Nexus | HTC OneX | Sony NSZ-GS7

Notice: I do not respond to tech support questions through PM.
The Following User Says Thank You to rogro82 For This Useful Post: [ Click to Expand ]
 
runandhide05
Old
(Last edited by runandhide05; 2nd December 2012 at 05:09 AM.)
#5  
runandhide05's Avatar
Recognized Contributor
Thanks Meter 2345
Posts: 2,694
Join Date: Apr 2011

 
DONATE TO ME
would someone do me a favor and attempt to make a phone call in a user profile that is not the main user, i added this in and i get fc when i attempt to make a call. just wondering what others are experiencing


Edit
So.I've had a few devs including myself add this to a quick build. All of us of different sources have the same issue and I would highly recommend not adding it because if someone had to dial out the phone FC when u press call
So imagine having to call 911. And you can't until your switch users... Probably not a good idea.
Its a great find. But that could cause some real problems
 
rogro82
Old
(Last edited by rogro82; 3rd December 2012 at 01:55 AM.)
#6  
rogro82's Avatar
Senior Recognized Developer - OP
Thanks Meter 440
Posts: 862
Join Date: May 2008

 
DONATE TO ME
We have implemented this change in our AOSP build on the HTC One X without any issues.

If you could get me a logcat of the crash I can take a look, but I cant think it has to do with multi-user support as it is already baked into JB yet only 1 user is enabled by default.

Are you sure you have only added:
<integer name="config_multiuserMaximumUsers">8</integer>

to your config.xml and did not add anything else?
Google+ | Twitter | GitHub

Most recent devices
Samsung Galaxy Note | Samsung Galaxy Nexus | HTC OneX | Sony NSZ-GS7

Notice: I do not respond to tech support questions through PM.
 
runandhide05
Old
#7  
runandhide05's Avatar
Recognized Contributor
Thanks Meter 2345
Posts: 2,694
Join Date: Apr 2011

 
DONATE TO ME
Quote:
Originally Posted by rogro82 View Post
We have implemented this change in our AOSP build on the HTC One X without any issues.

If you could get me a logcat of the crash I can take a look, but I cant think it has to do with multi-user support as it is already baked into JB yet only 1 user is enabled by default.

Are you sure you have only added:
<integer name="config_multiuserMaximumUsers">8</integer>

to your config.xml and did not add anything else?
Correct. And that was the only thing I changed. Keep in mind yes its built into aosp but only for phones. No log cat cause as soon as I ran into that problem I didn't bother to continue and just abandoned the changes. I did add the changes to aosp as well as a custom source and both had the same result as did a few other devs I had try it.
No worry's tho.
 
rogro82
Old
#8  
rogro82's Avatar
Senior Recognized Developer - OP
Thanks Meter 440
Posts: 862
Join Date: May 2008

 
DONATE TO ME
Quote:
Originally Posted by runandhide05 View Post
Correct. And that was the only thing I changed. Keep in mind yes its built into aosp but only for phones. No log cat cause as soon as I ran into that problem I didn't bother to continue and just abandoned the changes. I did add the changes to aosp as well as a custom source and both had the same result as did a few other devs I had try it.
No worry's tho.
K if you ever decide to give it another try and run into the same issue just post a logcat and ill be happy to look into it... as said we have this change applied in our aosp build and have no issues with calling or any other crash related to multi-user support
Google+ | Twitter | GitHub

Most recent devices
Samsung Galaxy Note | Samsung Galaxy Nexus | HTC OneX | Sony NSZ-GS7

Notice: I do not respond to tech support questions through PM.
 
runandhide05
Old
#9  
runandhide05's Avatar
Recognized Contributor
Thanks Meter 2345
Posts: 2,694
Join Date: Apr 2011

 
DONATE TO ME
Quote:
Originally Posted by rogro82 View Post
K if you ever decide to give it another try and run into the same issue just post a logcat and ill be happy to look into it... as said we have this change applied in our aosp build and have no issues with calling or any other crash related to multi-user support
OK I probably still have the zip laying around, I may through it on to.pull a log.
 
rogro82
Old
(Last edited by rogro82; 3rd December 2012 at 02:46 AM.)
#10  
rogro82's Avatar
Senior Recognized Developer - OP
Thanks Meter 440
Posts: 862
Join Date: May 2008

 
DONATE TO ME
nvm i now know what you mean... trying to call with a user other then the device owner FCs... Ill see if that can be fixed

Just looking at Phone package source:
* Returns the singleton instance of the PhoneApp if running as the
* primary user, otherwise null.

So then it crashes because it has no PhoneGlobals for the non-primary user.

Most probably the Phone app does not support multi-users because it would register the broadcast receiver for handling calls multiple times... If this can be fixed easily I cant answer immediatly
Google+ | Twitter | GitHub

Most recent devices
Samsung Galaxy Note | Samsung Galaxy Nexus | HTC OneX | Sony NSZ-GS7

Notice: I do not respond to tech support questions through PM.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes