Support multiple users (original) (raw)

Android supports multiple users on a single Android device by separating user accounts and app data. For instance, parents might allow their children to use the family tablet, a family can share an automobile, or a critical response team might share a mobile device for on-call duty.

Terminology

Android uses the following terms when describing Android users and accounts.

General

Android device management uses the following general terms:

Categories of users

Android device administration uses the following categories of users.

Categories of profiles

Android uses the following categories of profiles:

User types

Android 11 has formulated the above classification of users and profiles into well-defined_user types_, representing all the different types of users and profiles allowed by the Android Multi-user feature.

The pre-defined AOSP user types are defined inframeworks/base/core/java/android/os/UserManager.javaand currently include:

OEMs have the ability to configure these user types by overlaying theframeworks/base/core/res/res/xml/config_user_types.xml file. This facilitates changing the default configuration for each user type, including its default restrictions, icons, badges, and the maximum allowed number of users.

In addition to the configurable AOSP user types, OEMs can define new profile types using theframeworks/base/core/res/res/xml/config_user_types.xml file. This allows OEMs to introduce their own non-managed profile types if desired. However, it is the OEM's responsibility to make platform modifications as required to support the changes, including modifying any code that checks for managed profiles to now handle the new profile type if appropriate.

Enable the multi-user feature

The multi-user feature is disabled by default. To enable the feature, device manufacturers must define a resource overlay that replaces the following values in frameworks/base/core/res/res/values/config.xml:

1

false

To apply this overlay and enable guest and secondary users on the device, use the DEVICE_PACKAGE_OVERLAYS feature of the Android build system to replace the values for:

Device manufacturers can decide upon the maximum number of users. If device manufacturers or others have modified settings, they must ensure SMS and telephony work as defined in theAndroid Compatibility Definition Document (CDD).

Manage multiple users

Management of users and profiles (with the exception of restricted profiles) is performed by apps that programmatically invoke API in theDevicePolicyManager class to restrict use.

Enterprises can employ users and profiles to manage the lifetime and scope of apps and data on devices, using the types outlined above in conjunction with theDevicePolicyManagerand UserManagerAPIs to build unique solutions tailored to their use cases.

Multi-user system behavior

When users are added to a device, some functionality is curtailed when another user is in the foreground. Since app data is separated by user, the state of those apps differs by user. For example, email destined for an account of a user not currently in focus won't be available until that user and account are active on the device.

Note: To enable or disable the phone and SMS functions for a secondary user, go to Settings > Users, select the user, and switch the Allow phone calls and SMS setting to off.

Some restrictions exist when a secondary user is in background. For instance, the background secondary user cannot display the user interface or make Bluetooth services active. In addition, the system process halt background secondary users if the device needs additional memory for operations in the foreground user.

When employing multiple users on an Android device, keep the following behavior in mind:

Android Automotive multi-user

Android Automotive relies on Android's multi-user implementation to provide a shared device experience.

Automotive user types

In addition to the user types listed above, Automotive builds are notable for these types of users:

Caveats

The following exceptions apply to headless system user and regular (secondary) Users in Automotive:

Enable the headless system user

As of Android 10, the multi-user feature can be used for automotive use cases. Important distinctions include:

To enable the headless system user, device manufacturers must enable multi-user as described above.

When the headless user is enabled:

  1. To declare the device to be Automotive, add the featureandroid.hardware.type.automotive.
  2. Set ro.fw.headless_system_user to true.
  3. Set the value for config_multiuserMaximumUsers to 2 (or higher).

For more information, seeMulti-User Supportin Automotive.

Android Automotive multi-user on multiple displays

Android 15 allows full secondary users (who are not the current foreground user) to launch activities and get access to the UI on the display to which they are assigned. This feature enables multiple concurrent users in Android Automotive OS to support in-car experiences that provide multiple passengers with a dedicated UI experience in a single Android instance.

To enable this feature, device manufacturers must define a resource overlay to replace the following value inframeworks/base/core/res/res/values/config.xml:

false>

You can experiment with a passenger-only (no driver) experience by enabling the following additional config:

false

In Android 15, you can also enable the in-car experience for multiple passengers as guest users. To enable multiple guest users for development use, device manufacturers must define a resource overlay that configures max allowed number of guest users in frameworks/base/core/res/res/xml/config_user_types.xml, such as in this example: