Go to file
openharmony_ci f630be5b99 !4 修改测试资源配置,删除冗余文件
Merge pull request !4 from verystone/master
2021-07-10 02:34:38 +00: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 update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
sa_profile update OpenHarmony 2.0 Canary 2021-06-02 02:18:42 +08:00
services 针对分布式帐号,添加帐号登录状态变化事件的适配 2021-07-08 19:58:29 +08: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
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