Go to file
zhangalong 045b893ec4 codes for issue #I4UK3K
Signed-off-by:zhang_along<zhangalong@huawei.com>

Signed-off-by: zhangalong <zhangalong@huawei.com>
2022-02-21 18:31:18 +08:00
figures update readme 2022-02-19 16:27:51 +08:00
frameworks Add odaccount fuzzTest 2022-02-18 21:21:00 +08:00
interfaces Add odaccount fuzzTest 2022-02-18 21:21:00 +08:00
sa_profile update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
services !176 非首次开机时,acm dump命令查到的帐号激活状态与内存中实际不符 2022-02-19 06:43:25 +00:00
test Add odaccount fuzzTest 2022-02-18 21:21:00 +08:00
tools Allow get u0 data 2022-01-14 03:30:14 +08:00
.gitattributes update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
bundle.json Fix atomic ability bundle.json change 2022-02-14 14:09:24 +08:00
hisysevent.yaml codes for issue #I4RVID 2022-01-24 09:09:19 +08:00
LICENSE update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
OAT.xml 针对JSON格式文件,添加OAT检测规则 2021-07-31 18:31:23 +08:00
os_account.gni add app account oauth codes 2022-01-26 10:18:10 +08:00
README_zh.md codes for issue #I4UK3K 2022-02-21 18:31:18 +08:00
README.md update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00

os_account

Introduction

In a standard system, the OS account module supports login status management of distributed cloud accounts, interconnection with vendors' cloud account apps on the device side, and query and update of the cloud account login status.

Architecture

Figure 1 OS account architecture

Directory Structure

/base/account/os_account
├── common               # Common basic code
│   ├── account_error    # Error codes
│   ├── log              # Code for printing logs
│   ├── perf_stat        # Performance statistics
│   └── test             # Test code of common modules
├── interfaces           # APIs exposed externally
│   └── innerkits        # Header files for internal modules
├── kits                 # Development framework
├── sa_profile           # SA profile
├── services             # Service code
│   └── accountmgr       # Account manager service
└── test                 # Test code
    └── resource         # Test resources

Usage

Available APIs

The APIs available for distributed accounts can be called to query and update the account login status, and are supported only by system apps.

Table 1 Description of the distributed account module

Module

Description

distributedAccount

Provides methods for managing the distributed account module.

Table 2 Classes for distributed accounts

Class

Description

DistributedAccountAbility

Provides methods for querying and updating the login status of distributed accounts.

DistributedInfo

Provides methods for querying distributed account information, including the account name, UID, and login status.

Table 3 Methods for the distributed account module

Method

Description

function getDistributedAccountAbility(): DistributedAccountAbility

Obtains a singleton of a distributed account.

Table 4 DistributedAccountAbility description

Method

Description

queryOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): void

Queries information about the distributed account.

queryOsAccountDistributedInfo(): Promise<DistributedInfo>

Queries information about the distributed account.

updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback<boolean>): void

Updates information about the distributed account.

updateOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<boolean>

Updates information about the distributed account.

Repositories Involved

Account subsystem

account_os_account