Go to file
heruichen 297e21634e 修改JS API接口返回值
Signed-off-by: heruichen <heruichen2@huawei.com>
2021-09-28 19:02:46 -07:00
common update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
figures update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
interfaces/innerkits update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
kits/js/impl/napi/distributedaccount 修改JS API接口返回值 2021-09-28 19:02:46 -07:00
sa_profile update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
services 添加分布式帐号登录状态变化事件通知 2021-09-02 20:07:03 -07:00
test/resource/accountmgrservice 修改测试资源配置,删除冗余文件 2021-07-10 10:13:28 +08:00
.gitattributes update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +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
ohos.build update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
os_account.gni update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
README_zh.md update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +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