As stated in the official document, it is possible to enable android multiple user feature at build time, but there is no document about enabling it on an exiting android image. Is there a way to enable multi-user on an existing device (e.g. using adb) considering that root access is available?
Asked
Active
Viewed 1,767 times
2 Answers
1
Setting the property fw.max_users
to your desired value can enable multi-user support. Something like setprop fw.max_users $MAX_USERS
. Actually android itself reads this property to know if the device supports multi-user or not. You can refer to UserManger source code to find how android reads the maximum number of users. The following snippet is copied from UserManager source:
/**
* Returns the maximum number of users that can be created on this device.
A return value of 1 means that it is a single user device.
* @hide
* @return a value greater than or equal to 1
*/
@UnsupportedAppUsage
public static int getMaxSupportedUsers() {
// Don't allow multiple users on certain builds
if (android.os.Build.ID.startsWith("JVP")) return 1;
return SystemProperties.getInt("fw.max_users",
Resources.getSystem().getInteger(R.integer.config_multiuserMaximumUsers));
}

mahdi
- 598
- 5
- 22

Ashok Mutyala
- 89
- 1
- 4
-
This reads `@UnsupportedAppUsage`, which means not available to apps. – Martin Zeitler May 10 '22 at 16:24
-
1This is the API which will read when you queried from max users – Ashok Mutyala May 10 '22 at 17:21
-
This wasn't the question - and not even that getter can be called from an app. – Martin Zeitler May 11 '22 at 05:51
-
1This points that How we can change the No . of Users – Ashok Mutyala May 11 '22 at 06:48
-
1`setprop fw.max_users 8` worked on my device, where 8 was the number of desired max users. I think @MartinZeitler misread your answer, maybe editing it may make it more clear. – mahdi May 11 '22 at 07:24
1
One can edit /system/build.prop
on a rooted device and add multi-user support, then reboot:
fw.max_users=3
fw.show_multiuserui=1

Martin Zeitler
- 1
- 19
- 155
- 216