account_os_account/README.md
2021-06-02 02:18:42 +08:00

7.9 KiB
Executable File

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