---
# System prepended metadata

title: User Type in ChromeOS and Lacros Launching
tags: [elkurin-daily-note, Chromium-Lacros]

---

# User Type in ChromeOS and Lacros Launching

Users are asked to fill their email account to login to ChromeOS.  
This account is a user name, and there are several types of the user types.  
The user type also affects Lacros Launching through policy settings.

## user_type.h
[`USER_TYPE_*`](https://source.chromium.org/chromium/chromium/src/+/main:components/user_manager/user_type.h) enum shows the types.  
Let's see each of them.

### USER_TYPE_REGULAR
This is a regular user that has a user name, password and Gaia account. Gmail accounts (ending with @gmail.com) or managed commercial/EDU accounts are in this group.  
This account can take an ownership of the device.

### USER_TYPE_GUEST
This is a guest user. No Gaia account.  
You can login as a guest user by selecting "Browser as Guest" at the bottom-left on login screen.  
This type cannot take an ownership of the device.  
Lacros launching logic is special for this case. It does not return any policies.

### USER_TYPE_PUBLIC_ACCOUNT
This is called as a "Managed Guest Session" in other words.  
This is a guest session on enrolled device. It receives policies from DMserver similarly to the enrolled accounts, but work as a guest session so cannot take an ownership.  

[BrowserManager::PrepareLacrosPolicies](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/crosapi/browser_manager.cc;l=1789;drc=36e14afabf863f08eb32de3f68b69f3345301507) takes policy for public account from [DeviceLocalAccountPolicyService](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/policy/core/device_local_account_policy_service.h;l=49;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d). This is a class to manage user policy blobs for device-local accounts.

### USER_TYPE_KIOSK_APP
KIOSK mode is a feature to launch applications without real login. Kiosk is only allowed on commersial enrolled account, and not available on consumer device. This implies that Kiosk user is never used as an owner account since it requires to enroll with enterprise managed account before using it.

As same as Manages Guest Session, [BrowserManager::PrepareLacrosPolicies](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/crosapi/browser_manager.cc;l=1789;drc=36e14afabf863f08eb32de3f68b69f3345301507) takes policy for public account from [DeviceLocalAccountPolicyService](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/policy/core/device_local_account_policy_service.h;l=49;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d).

### USER_TYPE_CHILD
Similarly to `USER_TYPE_REGULAR`, it has a user name, password and Gaia account. The difference is that the user policy for the account is controlled by its parent accounts.  
While it is controlled by another account, it can take an owenrship.

`USER_TYPE_CHILD` is handled in the very similar way to `USER_TYPE_REGULAR` such as [BrowserManager::PrepareLacrosPolicies](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/crosapi/browser_manager.cc;l=1796-1809;drc=36e14afabf863f08eb32de3f68b69f3345301507), [regular_users_counter](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/login/existing_user_controller.cc;l=294-297;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d), [kAddPersonUserTypes](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/login/screens/locale_switch_screen.cc;l=193;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d)...

Note that `USER_TYPE_CHILD` account is not counted as an enterprise managed account ([ref](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/login/existing_user_controller.cc;l=903-905;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d))
```cpp=
bool is_enterprise_managed =
    profile_connector->IsManaged() &&
    user_context.GetUserType() != user_manager::USER_TYPE_CHILD;
```
It receives user policies from DMServer, but not device policies nor an owner key. Therefore, it needs to generate a new owner key in the same path as `USER_TYPE_REGULAR`.

Lacros is currently disabled on child account by default: [kLacrosForSuperviedUsers](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/crosapi/browser_util.cc;l=372;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d).

### USER_TYPE_ARC_KIOSK_APP
Kiosk app for Android apps. Similar to `USER_TYPE_KIOSK_APP` but dos not retrive any policy on preparing lacros launch.

### USER_TYPE_WEB_KIOSK_APP
Kiosk app for web apps. This is as known as PWA - Progressive Web Apps.  
PWA is a web site that users can install and experience as a stand alone app. It does not require login.  
Policy is retrived from [DeviceLocalAccountPolicyService](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/ash/policy/core/device_local_account_policy_service.h;l=49;drc=5a2e12875a8fe207bfe6f0febc782b6297788b6d) as same as `USER_TYPE_KIOSK_APP`.

## Note
I'm back from COVID. yeah~