In the standard system, the account subsystem implements lifecycle management of OS accounts, manages the distributed account login status, and adds or deletes app accounts.
Figure 1 Architecture of the OS account module
/base/account/os_account
├── figures Figures
├── frameworks Code of the account subsystem
│ ├── appaccount Internal API code of the app account module
│ │ └── native Code used to implement the app account internal APIs
│ ├── common Code of the common module
│ │ ├── account_error Error codes
│ │ ├── database Database code
│ │ ├── log Code for printing logs
│ │ ├── perf_stat Code for performance statistics
│ │ └── test Test code for the common module
│ ├── ohosaccount Internal API code of the distributed account module
│ │ ├── native Code used to implement the distributed account internal APIs
│ │ └── test Test code for the distributed account internal APIs
│ └── osaccount Internal API code of the OS account module
│ ├── core OS account IPC
│ └── native Code used to implement the OS account internal APIs
├── interfaces External APIs of the account subsystem
│ ├── innerkits Internal API header file
│ │ ├── appaccount Header file of the app account internal APIs
│ │ ├── ohosaccount Header file of the distributed account internal APIs
│ │ └── osaccount Header file of the OS account internal APIs
│ └── kits External API encapsulation
│ └── napi External API encapsulation code of the account subsystem
├── sa_profile SA profile directory of the account subsystem
├── services accountmgr service code
│ └── accountmgr Account subsystem service code
│ ├── include Service code header file
│ ├── src Source code of the account subsystem service code
│ └── test Test of the account subsystem service code
├── test Test code
│ ├── resource Test resource files
│ └── systemtest System test code
└── tools Tool code
├── acm acm tool
│ ├── include acm header file
│ └── src acm source file
└── test acm test code
The distributed account module provides APIs to query and update the account login status. These APIs can be used only by system apps.
Table 1 Description of the distributed account module
Table 2 Classes of distributedAccount
Provides methods for querying and updating the distributed account login status. |
|
Defines distributed account information, including the account name, account user ID (UID), and login status. |
Table 3 Description of DistributedAccountAbility
function getDistributedAccountAbility(): DistributedAccountAbility |
Obtains the **DistributedAccountAbility** singleton instance. |
Table 4 Methods of DistributedAccountAbility
The app account module provides APIs to add, delete, query, and modify an app account, enable or disable access to an app account, and flush and synchronize account data.
Table 5 Description of the app account module
Table 6 Classes of appAccount
Table 7 Description of AppAccountManager
Table 8Methods of AppAccountManager
The OS account module provides APIs to add, delete, query, set, subscribe to, and activate OS accounts, and flush OS account data to disks.
Table 9 Description of the OS account module
Table 10 Classes of osAccount
Table 11 Description of AccountManager
Table 12 Methods of AccountManager
Account subsystem
account_os_account