• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Common Events of the Account Subsystem
2This document lists the common system events provided by the account subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events.
3
4## COMMON_EVENT_USER_ADDED
5Indicates that a user has been added to the system.
6
7- Value: usual.event.USER_ADDED
8- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
9
10When a system account is created, the event notification service is triggered to publish this event carrying the system account ID.
11
12APIs related to this event: **createOsAccount** and **createOsAccountForDomain**. These APIs are system APIs. For details, see [@ohos.account.osAccount (OS Account Management)](../js-apis-osAccount.md).
13
14## COMMON_EVENT_USER_REMOVED
15Indicates that a user has been removed from the system.
16
17- Value: usual.event.USER_REMOVED
18- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
19
20When a system account is removed, the event notification service is triggered to publish this event carrying the system account ID.
21
22APIs related to this event: **removeOsAccount**. This API is a system API. For details, see [@ohos.account.osAccount (OS Account Management)](../js-apis-osAccount.md).
23
24## COMMON_EVENT_DOMAIN_ACCOUNT_STATUS_CHANGED<sup>10+<sup>
25Indicates that the status of the domain account status changes.
26
27- Value: usual.event.DOMAIN_ACCOUNT_STATUS_CHANGED
28- Required subscriber permissions: ohos.permission.GET_LOCAL_ACCOUNTS
29
30When a domain user account is authenticated, deleted, or has the token updated, the event notification service is triggered to publish this event carrying the system account ID, domain name, and account status.
31
32APIs related to this event: **removeOsAccount**, **DomainAccountManager.auth**, and **updateAccountToken**. These APIs are system APIs. For details, see [@ohos.account.osAccount (OS Account Management)](../js-apis-osAccount.md).
33
34## COMMON_EVENT_USER_SWITCHED
35Indicates that user switching is in progress.
36
37- Value: usual.event.USER_SWITCHED
38- Required subscriber permissions: ohos.permission.MANAGE_LOCAL_ACCOUNTS
39
40When the system account is switched, the event notification service is triggered to publish this event carrying the system account ID.
41
42APIs related to this event: **activateOsAccount**. This API is a system API. For details, see [@ohos.account.osAccount (OS Account Management)](../js-apis-osAccount.md).
43
44## COMMON_EVENT_USER_INFO_UPDATED<sup>9+<sup>
45Indicates that the user information has been updated.
46
47- Value: usual.event.USER_INFO_UPDATED
48- Required subscriber permissions: none
49
50When the distributed account information, system account profile picture, or system account name is changed, the event notification service is triggered to publish this event carrying the system account ID.
51
52APIs related to this event: **setOsAccountName**, **setOsAccountProfilePhoto**, and **setOsAccountDistributedInfon**. The first two are system APIs, and the last is a public API. For details, see [@ohos.account.osAccount (OS Account Management)](../js-apis-osAccount.md).
53
54## COMMON_EVENT_USER_UNLOCKED
55Indicates that the credential-encrypted storage has been unlocked for the current user after the device is restarted.
56
57- Value: usual.event.USER_UNLOCKED
58- Required subscriber permissions: none
59
60When the device is unlocked with the lock screen password the first time after user switching, the event notification service is triggered to publish this event carrying the system account ID.
61
62APIs related to this event: **auth**. This API is a system API. For details, see [@ohos.account.osAccount (OS Account Management)](../js-apis-osAccount.md).
63
64## COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGIN
65(Reserved, not supported yet) Indicates a successful login to a distributed account.
66
67- Value: common.event.DISTRIBUTED_ACCOUNT_LOGIN
68- Required subscriber permissions: none
69
70## COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOUT
71(Reserved, not supported yet) Indicates a successful logout of a distributed account.
72
73- Value: common.event.DISTRIBUTED_ACCOUNT_LOGOUT
74- Required subscriber permissions: none
75
76## COMMON_EVENT_DISTRIBUTED_ACCOUNT_TOKEN_INVALID
77(Reserved, not supported yet) Indicates the token of a distributed account is invalid.
78
79- Value: common.event.DISTRIBUTED_ACCOUNT_TOKEN_INVALID
80- Required subscriber permissions: none
81
82## COMMON_EVENT_DISTRIBUTED_ACCOUNT_LOGOFF
83(Reserved, not supported yet) Indicates that a distributed account is deregistered.
84
85- Value: common.event.DISTRIBUTED_ACCOUNT_LOGOFF
86- Required subscriber permissions: none
87