diff --git a/CODEOWNERS b/CODEOWNERS
index 9a386c2a47546563e5dbbf48be8464054f323e29..1723d5288fa2d4fa89dff9a3c2999c31370b55fd 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -135,7 +135,7 @@ zh-cn/application-dev/IDL/ @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingz
zh-cn/application-dev/device-usage-statistics/ @chenmingJay @ningningW @tangtiantian2021 @nan-xiansen @iceice1001
zh-cn/application-dev/ui/ @HelloCrease @huaweimaxuchu @tomatodevboy @niulihua
zh-cn/application-dev/notification/ @RayShih @jayleehw @li-weifeng2 @currydavids
-zh-cn/application-dev/windowmanager/ @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee
+zh-cn/application-dev/windowmanager/ @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/webgl/ @zengyawen @zhangqiang183 @wind_zj @zxg-gitee
zh-cn/application-dev/media/audio-overview.md @zengyawen @liuyuehua1 @saga2020 @currydavids
zh-cn/application-dev/media/audio-playback.md @zengyawen @liuyuehua1 @saga2020 @currydavids
@@ -186,9 +186,12 @@ zh-cn/application-dev/dfx/errormanager-guidelines.md @littlejerry1 @ccllee @chen
zh-cn/application-dev/dfx/errormanager-guidelines.md @littlejerry1 @ccllee @chengxingzhen @RayShih
zh-cn/application-dev/key-features/multi-device-app-dev/ @lingminghw @crazyracing0726
zh-cn/application-dev/database/ @ge-yafang @feng-aiwen @gong-a-shi @logic42
-zh-cn/application-dev/napi/native-window-guidelines.md @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee
-zh-cn/application-dev/napi/mindspore-lite-guidelines.md @ge-yafang @grbuzhidao @jianghui58 @auraxu
-zh-cn/application-dev/napi/mindspore-lite-offline-model-guidelines.md @ge-yafang @grbuzhidao @jianghui58 @auraxu
+zh-cn/application-dev/napi/native-window-guidelines.md @ge-yafang @zhangqiang183 @zhouyaoying @zxg-gitee @nobuggers
+zh-cn/application-dev/napi/mindspore-lite-guidelines.md @ge-yafang @principal87 @jianghui58
+zh-cn/application-dev/napi/mindspore-lite-offline-model-guidelines.md @ge-yafang @principal87 @jianghui58
+zh-cn/application-dev/reference/apis/js-apis-mindSporeLite.md @ge-yafang @principal87 @jianghui58
+zh-cn/application-dev/ai/mindspore-lite-js-guidelines.md @ge-yafang @principal87 @jianghui58
+zh-cn/application-dev/napi/neural-network-runtime-guidelines.md @ge-yafang @principal87 @win10wei
zh-cn/application-dev/napi/rawfile_guidelines.md @ningningW
zh-cn/application-dev/background-agent-scheduled-reminder/ @RayShih
zh-cn/application-dev/background-task-management/ @ningningW @wangwenli_wolf @tangtiantian2021 @nan-xiansen
@@ -275,9 +278,9 @@ zh-cn/application-dev/reference/apis/js-apis-application-shellCmdResult.md @litt
zh-cn/application-dev/reference/apis/js-apis-application-StartOptions.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-application-staticSubscriberExtensionAbility.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-application-Want.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
-zh-cn/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
-zh-cn/application-dev/application-models/windowextensionability.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
-zh-cn/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md @ge-yafang @zhouyaoying @zxg-gitee
+zh-cn/application-dev/reference/apis/js-apis-application-WindowExtensionAbility.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
+zh-cn/application-dev/application-models/windowextensionability.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
+zh-cn/application-dev/reference/apis/js-apis-inner-application-windowExtensionContext.md @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-appmanager.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-arraylist.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-audio.md @liuyuehua1 @zengyawen @magekkkk @currydavids
@@ -334,7 +337,7 @@ zh-cn/application-dev/reference/apis/js-apis-deque.md @gongjunsong @ge-yafang @f
zh-cn/application-dev/reference/apis/js-apis-device-info.md @mupceet @zengyawen @handyohos @nan-xiansen
zh-cn/application-dev/reference/apis/js-apis-device-manager.md @intermilano @RayShih @william-ligang @liuhonggang123
zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md @shuaytao @RayShih @wangzhen107 @inter515
-zh-cn/application-dev/reference/apis/js-apis-display.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
+zh-cn/application-dev/reference/apis/js-apis-display.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md @nianCode @zengyawen @JiDong-CS @murphy1984
zh-cn/application-dev/reference/apis/js-apis-distributed-data.md @feng-aiwen @ge-yafang @gong-a-shi @logic42
zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001
@@ -418,9 +421,8 @@ zh-cn/application-dev/reference/apis/js-apis-resource-manager.md @Buda-Liu @ning
zh-cn/application-dev/reference/apis/js-apis-router.md @huaweimaxuchu @HelloCrease @niulihua @tomatodevboy
zh-cn/application-dev/reference/apis/js-apis-rpc.md @xuepianpian @RayShih @zhaopeng_gitee @vagrant_world
zh-cn/application-dev/reference/apis/js-apis-runninglock.md @aqxyjay @zengyawen @aqxyjay @alien0208
-
-zh-cn/application-dev/reference/apis/js-apis-screen.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
-zh-cn/application-dev/reference/apis/js-apis-screenshot.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
+zh-cn/application-dev/reference/apis/js-apis-screen.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
+zh-cn/application-dev/reference/apis/js-apis-screenshot.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-securityLabel.md @panqinxu @zengyawen @bubble_mao @jinhaihw
zh-cn/application-dev/reference/apis/js-apis-sensor.md @hellohyh001 @ningningW @butterls @star-wind-snow-and-rain
zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
@@ -461,6 +463,8 @@ zh-cn/application-dev/reference/apis/js-apis-testRunner.md @inter515 @littlejerr
zh-cn/application-dev/reference/apis/js-apis-thermal.md @aqxyjay @zengyawen @aqxyjay @alien0208
zh-cn/application-dev/reference/apis/js-apis-timer.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-touchevent.md @mayunteng_1 @ningningW @cococoler @alien0208
+zh-cn/application-dev/reference/apis/js-apis-shortKey.md @mayunteng_1 @ningningW @cococoler @alien0208
+zh-cn/application-dev/reference/apis/js-apis-devicestatus-cooperate.md @mayunteng_1 @ningningW @cococoler @alien0208
zh-cn/application-dev/reference/apis/js-apis-treemap.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-treeset.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-uitest.md @inter515 @ningningW @inter515 @jiyong
@@ -476,17 +480,19 @@ zh-cn/application-dev/reference/apis/js-apis-vector.md @gongjunsong @ge-yafang @
zh-cn/application-dev/reference/apis/js-apis-vibrator.md @hellohyh001 @ningningW @butterls @star-wind-snow-and-rain
zh-cn/application-dev/reference/apis/js-apis-volumemanager.md @panqinxu @zengyawen @bubble_mao @jinhaihw
zh-cn/application-dev/reference/apis/js-apis-wallpaper.md @feng-aiwen @ningningW @wangzhangjun @murphy1984
+zh-cn/application-dev/reference/apis/js-apis-screen-lock.md @feng-aiwen @ningningW @wangzhangjun @murphy1984
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @littlejerry1 @RayShih @gwang2008 @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-webgl.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-webgl2.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-webSocket.md @zhang-hai-feng @zengyawen @jyh926 @gaoxi785
zh-cn/application-dev/reference/apis/js-apis-wifi.md @cheng_guohong @RayShih @cheng_guohong @quanli125
zh-cn/application-dev/reference/apis/js-apis-wifiext.md @cheng_guohong @RayShih @cheng_guohong @quanli125
-zh-cn/application-dev/reference/apis/js-apis-window.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee
+zh-cn/application-dev/reference/apis/js-apis-window.md @zhangqiang183 @ge-yafang @zhouyaoying @zxg-gitee @nobuggers
zh-cn/application-dev/reference/apis/js-apis-windowAnimationManager.md @zhangqiang183 @ge-yafang @wind_zj @zxg-gitee
zh-cn/application-dev/reference/apis/js-apis-worker.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-taskpool.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-workScheduler.md @chenmingJay @ningningW @nan-xiansen @iceice1001
+zh-cn/application-dev/reference/apis/js-apis-inner-application-WorkSchedulerExtensionContext.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-WorkSchedulerExtensionAbility.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-xml.md @gongjunsong @ge-yafang @flyingwolf @BlackStone
zh-cn/application-dev/reference/apis/js-apis-zlib.md @shuaytao @RayShih @wangzhen107 @inter515
@@ -532,6 +538,7 @@ zh-cn/application-dev/reference/apis/js-apis-curve.md @huaweimaxuchu @HelloCreas
zh-cn/application-dev/reference/apis/js-apis-defaultAppManager.md @shuaytao @RayShih @wangzhen107 @inter515
zh-cn/application-dev/reference/apis/js-apis-distributedBundle.md @shuaytao @RayShih @wangzhen107 @inter515
zh-cn/application-dev/reference/apis/js-apis-distributedKVStore.md @feng-aiwen @ge-yafang @gong-a-shi @logic42
+zh-cn/application-dev/reference/apis/js-apis-enterprise-applicationManager.md @liuzuming @ningningW @yangqing3
zh-cn/application-dev/reference/apis/js-apis-enterprise-accountManager.md @liuzuming @ningningW @yangqing3
zh-cn/application-dev/reference/apis/js-apis-enterprise-adminManager.md @liuzuming @ningningW @yangqing3
zh-cn/application-dev/reference/apis/js-apis-enterprise-bundleManager.md @liuzuming @ningningW @yangqing3
@@ -554,8 +561,10 @@ zh-cn/application-dev/reference/apis/js-apis-net-sharing.md @zhang-hai-feng @zen
zh-cn/application-dev/reference/apis/js-apis-nfctech.md @cheng_guohong @RayShih @cheng_guohong @quanli125
zh-cn/application-dev/reference/apis/js-apis-promptAction.md @huaweimaxuchu @HelloCrease @niulihua @tomatodevboy
zh-cn/application-dev/reference/apis/js-apis-reminderAgentManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001
+zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceStandby.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md @chenmingJay @ningningW @nan-xiansen @iceice1001
+zh-cn/application-dev/reference/apis/js-apis-resourceschedule-deviceStandby.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md @chenmingJay @ningningW @nan-xiansen @iceice1001
zh-cn/application-dev/reference/apis/js-apis-stationary.md @mayunteng_1 @ningningW @cococoler @alien0208
zh-cn/application-dev/reference/apis/js-apis-system-capability.md taiyipei taiyipei BlackStone
@@ -610,6 +619,7 @@ zh-cn/application-dev/reference/errorcodes/errorcode-request.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-resource-manager.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-router.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md @RayShih
+zh-cn/application-dev/reference/errorcodes/errorcode-screenlock.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-runninglock.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-sensor.md @ningningW
zh-cn/application-dev/reference/errorcodes/errorcode-system-parameterV9.md @zengyawen
diff --git a/en/application-dev/application-models/application-component-configuration-stage.md b/en/application-dev/application-models/application-component-configuration-stage.md
index b50d40b4a694ecdf55338d249a20ff458d36ba20..db1f4b9f8205993e30c1d4de1000fae72c6d5b08 100644
--- a/en/application-dev/application-models/application-component-configuration-stage.md
+++ b/en/application-dev/application-models/application-component-configuration-stage.md
@@ -6,7 +6,7 @@ Icons and labels are usually configured together. There is the application icon,
The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and entry labels. When you touch one of them, the corresponding UIAbility page is displayed.
-**Figure 1** Icons and labels
+**Figure 1** Icons and labels

diff --git a/en/application-dev/application-models/inputmethodextentionability.md b/en/application-dev/application-models/inputmethodextentionability.md
index b36cf2a050cd15c1d4047410406ed46343f604e5..49686c5d5c087d8a484123f0f6d58a12f6283976 100644
--- a/en/application-dev/application-models/inputmethodextentionability.md
+++ b/en/application-dev/application-models/inputmethodextentionability.md
@@ -1,4 +1,4 @@
-# InputMethodExtensionAbility Development
+# InputMethodExtensionAbility
## When to Use
[InputMethodExtensionAbility](../reference/apis/js-apis-inputmethod-extension-ability.md), inherited from [ExtensionAbility](extensionability-overview.md), is used for developing input method applications.
diff --git a/en/application-dev/application-models/serviceextensionability.md b/en/application-dev/application-models/serviceextensionability.md
index 3f9e96cf03318d900b428348bdb1bdfb0151f611..37f5d31a347dee577532850fd26a154e191a2a19 100644
--- a/en/application-dev/application-models/serviceextensionability.md
+++ b/en/application-dev/application-models/serviceextensionability.md
@@ -401,7 +401,7 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i
console.info(TAG, 'getBundleNameByUid: ' + callerBundleName);
// Identify the bundle name of the client.
if (callerBundleName != 'com.example.connectextapp') { // The verification fails.
- console.info(TAG, 'The caller bundle is not in whitelist, reject');
+ console.info(TAG, 'The caller bundle is not in trustlist, reject');
return;
}
// The verification is successful, and service logic is executed normally.
diff --git a/en/application-dev/application-models/windowextensionability.md b/en/application-dev/application-models/windowextensionability.md
index 3c1d364cd50e73c8232c5ba2482e04b2ca2a6077..bf593acef9ae090fd2e24fb5bdd88a40568094d2 100644
--- a/en/application-dev/application-models/windowextensionability.md
+++ b/en/application-dev/application-models/windowextensionability.md
@@ -1,4 +1,4 @@
-# WindowExtensionAbility
+# WindowExtensionAbility (for System Applications Only)
[WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md) is a type of ExtensionAbility component that allows a system application to be embedded in and displayed over another application.
@@ -15,7 +15,7 @@ the context is [WindowExtensionContext](../reference/apis/js-apis-inner-applicat
>
-## Setting an Embedded UIAbility (for System Applications Only)
+## Setting an Embedded UIAbility
The **WindowExtensionAbility** class provides **onConnect()**, **onDisconnect()**, and **onWindowReady()** lifecycle callbacks, which can be overridden.
@@ -79,7 +79,7 @@ To implement an embedded application, manually create a WindowExtensionAbility i
```
-## Starting an Embedded UIAbility (for System Applications Only)
+## Starting an Embedded UIAbility
System applications can load the created WindowExtensionAbility through the AbilityComponent.
diff --git a/en/application-dev/application-test/arkxtest-guidelines.md b/en/application-dev/application-test/arkxtest-guidelines.md
index 64edba5e9f4d4ebbd6b7bfbff44c4b01c8a67d4d..00c733c7c37676511ccab4d53dc9992b01456ff8 100644
--- a/en/application-dev/application-test/arkxtest-guidelines.md
+++ b/en/application-dev/application-test/arkxtest-guidelines.md
@@ -3,7 +3,7 @@
## Overview
-To accelerate test automation of OpenHarmony, arkXtest — an automated test framework that supports both the JavaScript (JS) and TypeScript (TS) programming languages — is provided.
+To accelerate test automation of OpenHarmony, arkXtest — an automated unit and UI test framework that supports both the JavaScript (JS) and TypeScript (TS) programming languages — is provided.
In this document you will learn about the key functions of arkXtest and how to use it to perform unit testing on application or system APIs and to write UI automated test scripts.
@@ -13,7 +13,7 @@ In this document you will learn about the key functions of arkXtest and how to u
arkXtest is part of the OpenHarmony toolkit and provides basic capabilities of writing and running OpenHarmony automated test scripts. In terms of test script writing, arkXtest offers a wide range of APIs, including basic process APIs, assertion APIs, and APIs related to UI operations. In terms of test script running, arkXtest offers such features as identifying, scheduling, and executing test scripts, as well as summarizing test script execution results.
-### Principles
+### Implementation
arkXtest is divided into two parts: unit test framework and UI test framework.
@@ -27,16 +27,16 @@ arkXtest is divided into two parts: unit test framework and UI test framework.

-- UI Testing Framework
+- UI Test Framework
- The UI test framework provides [UiTest APIs](../reference/apis/js-apis-uitest.md) for you to call in different test scenarios. The test scripts are executed on top of the unit test framework mentioned above.
+ The UI test framework provides [UiTest APIs](../reference/apis/js-apis-uitest.md) for you to call in different test scenarios. The UI test scripts are executed on top of the aformentioned unit test framework.
The figure below shows the main functions of the UI test framework.

-### Limitations and Constraints
+### Constraints
- The features of the UI test framework are available only in OpenHarmony 3.1 and later versions.
- The feature availability of the unit test framework varies by version. For details about the mappings between the features and versions, see [arkXtest](https://gitee.com/openharmony/testfwk_arkxtest/blob/master/README_en.md).
@@ -46,9 +46,9 @@ arkXtest is divided into two parts: unit test framework and UI test framework.
### Environment Requirements
-Software for writing test scripts: DevEco Studio 3.0 or later
+Software: DevEco Studio 3.0 or later
-Hardware for running test scripts: PC connected to an OpenHarmony device, such as the RK3568 development board
+Hardware: PC connected to an OpenHarmony device, such as the RK3568 development board
### Setting Up the Environment
@@ -57,7 +57,7 @@ Hardware for running test scripts: PC connected to an OpenHarmony device, such a
## Creating a Test Script
-1. Open DevEco Studio and create a project, where the **ohos** directory is where the test script is located.
+1. Open DevEco Studio and create a project, in which the **ohos** directory is where the test script is located.
2. Open the .ets file of the module to be tested in the project directory. Move the cursor to any position in the code, and then right-click and choose **Show Context Actions** > **Create Ohos Test** or press **Alt+Enter** and choose **Create Ohos Test** to create a test class.
## Writing a Unit Test Script
@@ -95,7 +95,7 @@ export default function abilityTest() {
The unit test script must contain the following basic elements:
-1. Import of the dependency package so that the dependent test APIs can be used.
+1. Import of the dependencies so that the dependent test APIs can be used.
2. Test code, mainly about the related logic, such as API invoking.
@@ -105,7 +105,7 @@ The unit test script must contain the following basic elements:
You write a UI test script based on the unit test framework, adding the invoking of APIs provided by the UI test framework to implement the corresponding test logic.
-In this example, the UI test script is written based on the preceding unit test script. First, add the dependency package, as shown below:
+In this example, the UI test script is written based on the preceding unit test script. First, import the dependency, as shown below:
```js
import {Driver,ON,Component,MatchPattern} from '@ohos.uitest'
@@ -158,11 +158,9 @@ export default function abilityTest() {
You can run a test script in DevEco Studio in any of the following modes:
-1. Test package level: All test cases in the test package are executed.
-
-2. Test suite level: All test cases defined in the **describe** method are executed.
-
-3. Test method level: The specified **it** method, that is, a single test case, is executed.
+- Test package level: All test cases in the test package are executed.
+- Test suite level: All test cases defined in the **describe** method are executed.
+- Test method level: The specified **it** method, that is, a single test case, is executed.

@@ -176,7 +174,7 @@ After the test is complete, you can view the test result in DevEco Studio, as sh
To run a test script in the CLI, execute **aa** commands with different execution control keywords.
-Parameters in aa test commands
+The table below lists the keywords in **aa** test commands.
| Keyword | Abbreviation| Description | Example |
| ------------- | ------------ | -------------------------------------- | ---------------------------------- |
@@ -187,18 +185,18 @@ Parameters in aa test commands
The framework supports multiple test case execution modes, which are triggered by the key-value pair following the **-s** keyword. The table below lists the available keys and values.
-| Key | Description | Value | Parameter |
+| Key | Description | Value | Example |
| ------------ | ----------------------------------------------------------------------------- | ------------------------------------------------------------ | ----------------------------------------- |
-| unittest | OpenHarmonyTestRunner object used for test case execution. | **OpenHarmonyTestRunner** or custom runner name. | - s unittest OpenHarmonyTestRunner |
+| unittest | **OpenHarmonyTestRunner** object used for test case execution. | **OpenHarmonyTestRunner** or custom runner name. | - s unittest OpenHarmonyTestRunner |
| class | Test suite or test case to be executed. | {describeName}#{itName}, {describeName} | -s class attributeTest#testAttributeIt |
| notClass | Test suite or test case that does not need to be executed. | {describeName}#{itName}, {describeName} | -s notClass attributeTest#testAttributeIt |
| itName | Test case to be executed. | {itName} | -s itName testAttributeIt |
| timeout | Timeout interval for executing a test case. | Positive integer (unit: ms). If no value is set, the default value 5000 is used. | -s timeout 15000 |
-| breakOnError | Whether to enable break-on-error mode. When this mode is enabled, the test execution process exits if a test assertion error or any other error occurs.| **true**/**false** (default value) | -s breakOnError true |
+| breakOnError | Whether to enable break-on-error mode. When this mode is enabled, the test execution process exits if a test assertion failure or error occurs.| **true**/**false** (default value) | -s breakOnError true |
| random | Whether to execute test cases in random sequence.| **true**/**false** (default value) | -s random true |
| testType | Type of the test case to be executed. | function, performance, power, reliability, security, global, compatibility, user, standard, safety, resilience| -s testType function |
| level | Level of the test case to be executed. | 0, 1, 2, 3, 4 | -s level 0 |
-| size | Size of the test case to be executed. | small, medium, large | -s size small |
+| size | Size of the test case to be executed. | small, medium, large | -s size small
| stress | Number of times that the test case is executed. | Positive integer | -s stress 1000 |
**Running Commands**
@@ -306,7 +304,7 @@ OHOS_REPORT_STATUS: consuming=4
| OHOS_REPORT_STATUS: stream | Error information of the current test case.|
| OHOS_REPORT_STATUS: test| Name of the current test case.|
| OHOS_REPORT_STATUS_CODE | Execution result of the current test case. The options are as follows: **0**: pass **1**: error **2**: fail|
-| OHOS_REPORT_STATUS: consuming | Execution duration of the current test case.|
+| OHOS_REPORT_STATUS: consuming | Time spent in executing the current test case.|
- After the commands are executed, the log information similar to the following is displayed:
@@ -324,7 +322,7 @@ OHOS_REPORT_STATUS: taskconsuming=16029
| Failure | Number of failed test cases.|
| Error | Number of test cases whose execution encounters errors. |
| Pass | Number of passed test cases.|
-| Ignore | Number of test cases not executed.|
+| Ignore | Number of test cases not yet executed.|
| taskconsuming| Total time spent in executing the current test case.|
> When an error occurs in break-on-error mode, check the **Ignore** and interrupt information.
@@ -341,11 +339,11 @@ The logs added to the test case are displayed after the test case execution, rat
**Possible Causes**
-More than one asynchronous interface is called in the test case. In principle, logs in the test case are printed before the test case execution is complete.
+More than one asynchronous API is called in the test case. In principle, logs in the test case are printed before the test case execution is complete.
**Solution**
-If more than one asynchronous interface is called, you are advised to encapsulate the interface invoking into the promise mode
+If more than one asynchronous API is called, you are advised to encapsulate the API invoking into the promise mode.
#### Error "fail to start ability" is reported during test case execution
@@ -373,7 +371,7 @@ After the test case execution is complete, the console displays the error messag
2. The time taken for API invocation is longer than the timeout interval set for test case execution.
-3. Test assertion fails, and a failure exception is thrown. As a result, the test case execution does not end until the timeout expires.
+3. Test assertion fails, and a failure exception is thrown. As a result, the test case execution does not end until it times out.
**Solution**
@@ -388,11 +386,11 @@ After the test case execution is complete, the console displays the error messag
**Problem**
-The UI test case fails to be executed. The HiLog file contains the error message "Get windows failed/GetRootByWindow failed".
+The UI test case fails to be executed. The HiLog file contains the error message "Get windows failed/GetRootByWindow failed."
**Possible Causes**
-The ArkUI feature is disabled. As a result, the control tree information on the test page is not generated.
+The ArkUI feature is disabled. As a result, the component tree information is not generated on the test page.
**Solution**
@@ -410,13 +408,13 @@ The UI test case fails to be executed. The HiLog file contains the error message
**Possible Causes**
-1. In the test case, the **await** operator is not added to the asynchronous interface provided by the UI test framework.
+1. In the test case, the **await** operator is not added to the asynchronous API provided by the UI test framework.
2. The UI test case is executed in multiple processes. As a result, multiple UI test processes are started. The framework does not support multi-process invoking.
**Solution**
-1. Check the case implementation and add the **await** operator to the asynchronous interface invoking.
+1. Check the case implementation and add the **await** operator to the asynchronous API.
2. Do not execute UI test cases in multiple processes.
@@ -424,11 +422,11 @@ The UI test case fails to be executed. The HiLog file contains the error message
**Problem**
-The UI test case fails to be executed. The HiLog file contains the error message "does not exist on current UI! Check if the UI has changed after you got the widget object".
+The UI test case fails to be executed. The HiLog file contains the error message "does not exist on current UI! Check if the UI has changed after you got the widget object."
**Possible Causes**
-After the target component is found in the code of the test case, the device UI changes. As a result, the found component is lost and the emulation operation cannot be performed.
+After the target component is found in the code of the test case, the device UI changes, resulting in loss of the found component and inability to perform emulation.
**Solution**
diff --git a/en/application-dev/connectivity/http-request.md b/en/application-dev/connectivity/http-request.md
index 45a20ef6a48d0746a1c82a0e1b577d7354e8938d..1bb784cf96fb1d74dcbafed54498435f505814b6 100644
--- a/en/application-dev/connectivity/http-request.md
+++ b/en/application-dev/connectivity/http-request.md
@@ -78,6 +78,8 @@ httpRequest.request(
// data.header carries the HTTP response header. Parse the content based on service requirements.
console.info('header:' + JSON.stringify(data.header));
console.info('cookies:' + JSON.stringify(data.cookies)); // 8+
+ // Call the destroy() method to release resources after HttpRequest is complete.
+ httpRequest.destroy();
} else {
console.info('error:' + JSON.stringify(err));
// Unsubscribe from HTTP Response Header events.
@@ -158,4 +160,11 @@ httpRequest.request2(
httpRequest.destroy();
}
);
-```
\ No newline at end of file
+```
+
+## Samples
+
+The following sample is provided to help you better understand how to develop the HTTP data request feature:
+
+- [`Http`: Data Request (ArkTS) (API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Connectivity/Http)
+- [HTTP Communication (ArkTS) (API9)](https://gitee.com/openharmony/codelabs/tree/master/NetworkManagement/SmartChatEtsOH)
diff --git a/en/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md b/en/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
index 82027e91a9c15b1fd1b62a8c5ef4cddc2f9c0ef3..067f372d7e27e568d3208f651b57132ecc3edd72 100644
--- a/en/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
+++ b/en/application-dev/device-usage-statistics/device-usage-statistics-use-guide.md
@@ -1,4 +1,4 @@
-# Device Usage Statistics Development (API Version 9)
+# Device Usage Statistics Development
## When to Use
@@ -38,7 +38,7 @@ import usageStatistics from '@ohos.resourceschedule.usageStatistics';
## How to Develop
1. Before obtaining the device usage statistics, check whether the **ohos.permission.BUNDLE_ACTIVE_INFO** permission is configured. For details about how to configure a permission, see [Declaring Permissions](../security/accesstoken-guidelines.md).
-
+
2. Query events of all applications based on the specified start time and end time. This requires the **ohos.permission.BUNDLE_ACTIVE_INFO** permission to be configured.
```js
diff --git a/en/application-dev/dfx/hitracemeter-guidelines.md b/en/application-dev/dfx/hitracemeter-guidelines.md
index 3adf91286aaf410d7862c60320878e57acb359e8..3244aa9356bbcd3748594061a3752fad8aa3d3f3 100644
--- a/en/application-dev/dfx/hitracemeter-guidelines.md
+++ b/en/application-dev/dfx/hitracemeter-guidelines.md
@@ -21,7 +21,7 @@ Due to the asynchronous I/O feature of JS, the hiTraceMeter module provides only
## Available APIs
-The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference]( ../reference/apis/js-apis-hitracemeter.md).
+The performance tracing APIs are provided by the **hiTraceMeter** module. For details, see [API Reference](../reference/apis/js-apis-hitracemeter.md).
**APIs for performance tracing**
diff --git a/en/application-dev/faqs/faqs-dfx.md b/en/application-dev/faqs/faqs-dfx.md
index 51945bd8d0b9742703696d19fd2cc1f52add112d..9a4f4dc610e282afe74d7b73c8cfb7579db0a728 100644
--- a/en/application-dev/faqs/faqs-dfx.md
+++ b/en/application-dev/faqs/faqs-dfx.md
@@ -4,17 +4,13 @@
Applicable to: OpenHarmony 3.2 Beta (API version 9)
-**Symptom**
-
-How do I flush HiLog information to disks?
-
**Solution**
Run the **hilog -w start -f ckTest -l 1M -n 5 -m zlib -j 11** command.
The log file is saved in the **/data/log/hilog/** directory.
-Parameter description:
+**Parameters:**
```
-**-w**: Starts a log flushing task. **start** means to start the task, and **stop** means to stop the task.
@@ -25,3 +21,129 @@ Parameter description:
-**-j**: Specifies the task ID. The value ranges from **10** to **0xffffffffff**.
For more details about parameters, run the **hilog --help** command.
```
+
+## How do I print only HiLog information of the current application?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Solution**
+
+Use the hilog command line tool to filter the logs of the current application.
+
+**hilog -T xxx**: filtering logs by tag.
+
+**hilog –D xxx**: filtering logs by domain.
+
+**hilog -e**: matching log content based on the tag, domain, and pid by using regular expressions. Multi-layered filtering, combination filtering, and reverse filtering are supported.
+
+## How do I locate the fault when the application crashes?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Solution**
+
+Method 1: Locate the crash-related code based on the service log.
+
+Method 2: View the error information in the crash file. The crash file is located at **/data/log/faultlog/faultlogger/**.
+
+## Is HiLog or console recommended for log printing? How do I set the domain if HiLog is used?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+The console encapsulates the HiLog system with the default parameter configuration. It is mainly used in the application development and debugging phase.
+
+HiLog is recommended because it supports log classification and processing in a unified manner. For details, see [@ohos.hilog (HiLog)](../reference/apis/js-apis-hilog.md#hilogisloggable).
+
+The value of the **domain** parameter in the HiLog API ranges from **0x0** to **0xFFFF**. You are advised to customize the value as required.
+
+## What is the maximum length of a log record when HiLog is used? Is it configurable?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+The maximum length of a log record is 1,024 characters, and it is not changeable.
+
+## What is the purpose of using private in printing of formatted logs?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Symptom**
+
+**private** is displayed in HiLog information when format parameters are of the %d or %s type in C++.
+
+**Solution**
+
+When format parameters such as **%d** and **%s** are directly used, the standard system uses **private** to replace the actual data for printing by default to prevent data leakage. To print the actual data, replace **%d** with **%{public}d** or replace **%s** with **%{public}s**.
+
+## What should I do if the hilog.debug log cannot be printed?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Solution**
+
+Run **hdc std shell hilog -b D** to turn on the debugging switch.
+
+## Can I separate multiple strings by spaces in the tag parameter of the HiLog API?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+Yes.
+
+## How does HiLog print the log information marked with the \{private\} tag?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Solution**
+
+To print the log information marked with the \{private\} tag, run the command to disable the privacy mode: hdc shell hilog -p off
+
+## What are the cash log collection and performance troubleshooting functions provided by the HiLog system?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Symptom**
+
+What are the cash log collection and performance troubleshooting functions provided by the HiLog system?
+
+**Solution**
+
+FaultLogger: collects crash logs. For details, see [FaultLogger](../reference/apis/js-apis-faultLogger.md).
+
+HiChecker: detects potential faults. For details, see [HiChecker](../reference/apis/js-apis-hichecker.md).
+
+hiTraceMeter: implements performance tracing. For details, see [hiTraceMeter](../reference/apis/js-apis-hitracemeter.md).
+
+## How do I control log output?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+**Symptom**
+
+The output log varies according to environment requirements.
+
+**Solution**
+
+You can run the following command to adjust the log level to print the desired logs:
+
+hdc shell hilog -L
+
+## Is there a limit on the tag length of HiLog?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+The length of the entire tag is 32.
+
+## How do I view the appfreeze information in the logs?
+
+Applicable to: OpenHarmony 3.2 Beta (API version 9)
+
+Try the following procedure:
+
+1. Check the reason for the event. Fault location methods and examples are provided specifically to different reasons.
+
+2. Check the MSG information.
+
+3. Check the application stack information in OpenStacktraceCatcher as well as the HiLog information for the operation that leads to the event.
+
+4. Check the PeerBinderCatcher process to see if the current process is suspended by the peer binder. If there is a synchronous wait related to the current process, the corresponding PeerBinder Stacktrace information will be logged. It contains the stack information of the peer process that leads to suspension of the current process.
+
+5. Check the CPU usage of system processes and the memory usage of the current process.
diff --git a/en/application-dev/faqs/faqs-globalization.md b/en/application-dev/faqs/faqs-globalization.md
index b4d06ab98cbb1b24f4f0384ed893126c334ff383..c8d310a70c90338ffb5f63513508ea0100ad5192 100644
--- a/en/application-dev/faqs/faqs-globalization.md
+++ b/en/application-dev/faqs/faqs-globalization.md
@@ -2,13 +2,13 @@
## How do I read an XML file in rawfile and convert the data in it to the string type?
-Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution**
Call **getRawFileContent** of the **ResourceManager** module to obtain the data in the XML file, and then use **String.fromCharCode** to convert the data to the string type.
-**Sample Code**
+**Example**
```
resourceManager.getRawFileContent('test.xml', (error, value) => {
@@ -21,7 +21,7 @@ resourceManager.getRawFileContent('test.xml', (error, value) => {
});
```
-**Reference**
+**Reference Link**
[Resource Manager](../reference/apis/js-apis-resource-manager.md)
@@ -33,7 +33,7 @@ Applicable to: OpenHarmony 3.1 Beta 5 (API version 9)
The stage model allows an application to obtain a **ResourceManager** object based on **context** and call its resource management APIs without first importing the required bundle. This mode does not apply to the FA model.
-**Sample Code**
+**Example**
```
const context = getContext(this) as any
@@ -63,13 +63,13 @@ To obtain the path of the **resource** directory, try either of the following wa
2. Use **ResourceManager** for access. This method applies to dynamic access, during which the **resource** directory dynamically changes when the application is running.
-**Reference**
+**Reference Link**
[Resource Categories and Access](../quick-start/resource-categories-and-access.md) and [Resource Manager](../reference/apis/js-apis-resource-manager.md)
## Why does getPluralString return an incorrect value?
-Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Symptom**
@@ -81,19 +81,19 @@ The **getPluralString** API is effective only when the system language is Englis
## How do I obtain the customized string fields in the resources directory?
-Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution**
Use **getStringValue** of the **ResourceManager** module.
-**Reference**
+**Reference Link**
[Resource Manager](../reference/apis/js-apis-resource-manager.md#getstringvalue9)
## How do I reference resources such as images and text in AppScope?
-Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution**
@@ -101,18 +101,50 @@ Reference resources in the **\$r\('app.type.name'\)** format. Wherein, **type**
## How do I convert resources to strings?
-Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**Solution**
For a qualifier directory, use **this.context.resourceManager.getStringSync\(\$r\('app.string.test'\).id\)** to covert resources to strings synchronously. Note that the **\$r\('app.string.test', 2\)** mode is not supported.
-**Reference**
+**Reference Link**
[Resource Manager](../reference/apis/js-apis-resource-manager.md#getstringsync9)
## Can $ be used to reference constants in the form\_config.json file?
-Applicable to: OpenHarmony 3.2 Beta 5 (API version 9)
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
**\$** cannot be used to reference constants in the **form\_config.json** file.
+
+## How does ArkTS parse XML files?
+
+Applicable to: OpenHarmony 3.2 Beta5 (API version 9)
+
+**Solution**
+
+1. Create the following XML file in the **rawfile** directory:
+
+ ```
+
+
+ Jacky
+ 18
+
+ ```
+
+2. Use **resourceManager.getRawFileContent** to obtain the byte arrays of the XML file.
+
+ ```
+ import resourceManager from '@ohos.resourceManager';
+ resourceManager.getRawFileContent("test.xml", (error, value) => {
+ if (error != null) {
+ console.log("error is " + error);
+ return
+ }
+ let arrayBuffer = value.buffer; // unit8Array
+ var xmpParser = new xml.XmlPullParser(arrayBuffer);
+ var tagName = ""
+ //do something
+ }
+ ```
diff --git a/en/application-dev/faqs/faqs-window-manager.md b/en/application-dev/faqs/faqs-window-manager.md
index cc3cb1074bd8ae828ae38925a74594311b0f6c35..b8e2bbd78963fd25031da5b4b29c17e849f8b7ba 100644
--- a/en/application-dev/faqs/faqs-window-manager.md
+++ b/en/application-dev/faqs/faqs-window-manager.md
@@ -114,7 +114,7 @@ In effect, the **isStatusBarLightIcon** and **isNavigationBarLightIcon** attribu
**Reference**
-[window.SystemBarProperties](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-window.md#systembarproperties)
+[window.SystemBarProperties](../reference/apis/js-apis-window.md#systembarproperties)
## How do I keep the screen always on?
diff --git a/en/application-dev/file-management/Readme-EN.md b/en/application-dev/file-management/Readme-EN.md
index bdc1bc7c1b00195bc24c71396f4fed78b93de15a..e96bf81837a170a61796100c3f1e0080687f39ec 100644
--- a/en/application-dev/file-management/Readme-EN.md
+++ b/en/application-dev/file-management/Readme-EN.md
@@ -15,8 +15,8 @@
- Selecting and Saving User Files (FilePicker)
- [Selecting User Files](select-user-file.md)
- [Saving User Files](save-user-file.md)
- - [Developing a FileManager Application (Available Only for System Applications)](dev-user-file-manager.md)
- - [Managing External Storage Devices (Available Only for System Applications)](manage-external-storage.md)
+ - [Developing a FileManager Application (for System Applications Only)](dev-user-file-manager.md)
+ - [Managing External Storage Devices (for System Applications Only)](manage-external-storage.md)
- Distributed File System
- [Distributed File System Overview](distributed-fs-overview.md)
- [Setting the Security Level of a Distributed File](set-security-label.md)
diff --git a/en/application-dev/file-management/dev-user-file-manager.md b/en/application-dev/file-management/dev-user-file-manager.md
index e048ad7fefa3cf5ddf26ad3764403231cc3045dd..26181bb321310d1261ce2b87138b7fd2aa118552 100644
--- a/en/application-dev/file-management/dev-user-file-manager.md
+++ b/en/application-dev/file-management/dev-user-file-manager.md
@@ -1,4 +1,4 @@
-# Developing a FileManager Application (Available Only for System Applications)
+# Developing a FileManager Application (for System Applications Only)
OpenHarmony is prebuilt with the **FileManager** application. You can also develop your own **FileManager** as required.
diff --git a/en/application-dev/file-management/manage-external-storage.md b/en/application-dev/file-management/manage-external-storage.md
index 9889b4f8f0f6caaf49f0801c6d92ffe2f8bfc11f..bd5c01712cb48d6b8ac151b67a5b747967882870 100644
--- a/en/application-dev/file-management/manage-external-storage.md
+++ b/en/application-dev/file-management/manage-external-storage.md
@@ -1,4 +1,4 @@
-# Managing External Storage Devices (Available Only for System Applications)
+# Managing External Storage Devices (for System Applications Only)
External storage devices are pluggable. OpenHarmony provides the functions of listening for the device insertion and removal events and mounting/unmounting an external storage device.
@@ -28,13 +28,13 @@ The following table describes the broadcast related parameters.
**Table 1** Broadcast parameters
-| Broadcast| Parameter|
+| Broadcast| Parameter|
| -------- | -------- |
-| usual.event.data.VOLUME_REMOVED | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs.|
-| usual.event.data.VOLUME_UNMOUNTED | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs. **volumeState**: state of the volume.|
-| usual.event.data.VOLUME_MOUNTED | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs. **volumeState**: state of the volume. **fsUuid**: universally unique identifier (UUID) of the volume. **path**: path where the volume is mounted.|
-| usual.event.data.VOLUME_BAD_REMOVAL | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs.|
-| usual.event.data.VOLUME_EJECT | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs. **volumeState**: state of the volume.|
+| usual.event.data.VOLUME_REMOVED | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs.|
+| usual.event.data.VOLUME_UNMOUNTED | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs. **volumeState**: state of the volume.|
+| usual.event.data.VOLUME_MOUNTED | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs. **volumeState**: state of the volume. **fsUuid**: universally unique identifier (UUID) of the volume. **path**: path where the volume is mounted.|
+| usual.event.data.VOLUME_BAD_REMOVAL | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs.|
+| usual.event.data.VOLUME_EJECT | **id**: ID of the volume. **diskId**: ID of the disk to which the volume belongs. **volumeState**: state of the volume.|
## How to Develop
diff --git a/en/application-dev/media/Readme-EN.md b/en/application-dev/media/Readme-EN.md
index efc78832291fda395506dc0864af4fae0f068621..a9fe35694fd7458fe31cf6a5d2473f5d93757bd1 100755
--- a/en/application-dev/media/Readme-EN.md
+++ b/en/application-dev/media/Readme-EN.md
@@ -28,7 +28,7 @@
- [Developing Audio Call](audio-call-development.md)
- [Video Playback](video-playback.md)
- [Video Recording](video-recording.md)
-- AVSession (for System Applications Only)
+- AVSession
- [AVSession Overview](avsession-overview.md)
- Local AVSession
- [Local AVSession Overview](local-avsession-overview.md)
@@ -37,7 +37,7 @@
- Distributed AVSession
- [Distributed AVSession Overview](distributed-avsession-overview.md)
- [Using Distributed AVSession](using-distributed-avsession.md)
-- Camera (for System Applications Only)
+- Camera
- [Camera Overview](camera-overview.md)
- Camera Development
- [Camera Development Preparations](camera-preparation.md)
diff --git a/en/application-dev/media/using-avsession-controller.md b/en/application-dev/media/using-avsession-controller.md
index 958661d90cec031cbbca1bb7c11ccb80e4dc0e66..d1569d6dc055a5d604c54e0f8970e779cddfb721 100644
--- a/en/application-dev/media/using-avsession-controller.md
+++ b/en/application-dev/media/using-avsession-controller.md
@@ -26,11 +26,7 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| -------- | -------- |
| getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void | Obtains the descriptors of all AVSessions in the system.|
| createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void | Creates an AVSessionController.|
-| getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void | Obtains valid commands supported by the AVSession. Playback control commands listened by an audio and video application when it accesses the AVSession are considered as valid commands supported by the AVSession. For details, see [Provider of AVSession](using-avsession-developer.md).|
-| getLaunchAbility(callback: AsyncCallback<WantAgent>): void | Obtains the UIAbility that is configured in the AVSession and can be started. The UIAbility configured here is started when a user operates the UI of the controller, for example, clicking a widget in Media Controller.|
-| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | Sends a key event to an AVSession through the AVSessionController object.|
| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | Sends a key event to the top session.|
-| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | Sends a playback control command to an AVSession through the AVSessionController object.|
| sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | Sends a playback control command to the top session.|
| getHistoricalSessionDescriptors(maxSize: number, callback: AsyncCallback\>>): void10+ | Obtains the descriptors of historical sessions.|
@@ -38,15 +34,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| API| Description|
| -------- | -------- |
-| getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void | Obtains the information related to the playback state.|
-| getAVMetadata(callback: AsyncCallback<AVMetadata>): void | Obtains the session metadata.|
-| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void | Obtains the output device information.|
-| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | Sends a key event to the session corresponding to this controller.|
-| getLaunchAbility(callback: AsyncCallback<WantAgent>): void | Obtains the **WantAgent** object saved by the application in the session.|
-| isActive(callback: AsyncCallback<boolean>): void | Checks whether the session is activated.|
-| destroy(callback: AsyncCallback<void>): void | Destroys this controller. A controller can no longer be used after being destroyed.|
-| getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void | Obtains valid commands supported by the session.|
-| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | Sends a playback control command to the session through the controller.|
+| getAVPlaybackState(callback: AsyncCallback<AVPlaybackState>): void10+ | Obtains the information related to the playback state.|
+| getAVMetadata(callback: AsyncCallback<AVMetadata>): void10+ | Obtains the session metadata.|
+| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void10+ | Obtains the output device information.|
+| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void10+ | Sends a key event to the session corresponding to this controller.|
+| getLaunchAbility(callback: AsyncCallback<WantAgent>): void10+ | Obtains the **WantAgent** object saved by the application in the session.|
+| isActive(callback: AsyncCallback<boolean>): void10+ | Checks whether the session is activated.|
+| destroy(callback: AsyncCallback<void>): void10+ | Destroys this controller. A controller can no longer be used after being destroyed.|
+| getValidCommands(callback: AsyncCallback<Array<AVControlCommandType>>): void10+ | Obtains valid commands supported by the session.|
+| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void10+ | Sends a playback control command to the session through the controller.|
| sendCommonCommand(command: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void10+ | Sends a custom playback control command to the session through the controller.|
| getAVQueueItems(callback: AsyncCallback<Array<AVQueueItem>>): void10+ | Obtains the information related to the items in the playlist.|
| getAVQueueTitle(callback: AsyncCallback<string>): void10+ | Obtains the name of the playlist.|
diff --git a/en/application-dev/media/using-avsession-developer.md b/en/application-dev/media/using-avsession-developer.md
index bf0b914647b9c364bea0ac86a30def88fe3c0f52..eef132d493091f6041450b7d3a42249fc081ce05 100644
--- a/en/application-dev/media/using-avsession-developer.md
+++ b/en/application-dev/media/using-avsession-developer.md
@@ -16,15 +16,15 @@ For details, see [AVSession Management](../reference/apis/js-apis-avsession.md).
| API| Description|
| -------- | -------- |
-| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession>): void | Creates an AVSession. Only one AVSession can be created for a UIAbility.|
-| setAVMetadata(data: AVMetadata, callback: AsyncCallback<void>): void | Sets AVSession metadata.|
-| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void>): void | Sets the AVSession playback state.|
-| setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void>): void | Starts a UIAbility.|
-| getController(callback: AsyncCallback<AVSessionController>): void | Obtains the controller of the AVSession.|
-| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void | Obtains the output device information.|
-| activate(callback: AsyncCallback<void>): void | Activates the AVSession.|
-| deactivate(callback: AsyncCallback<void>): void | Deactivates this session.|
-| destroy(callback: AsyncCallback<void>): void | Destroys the AVSession.|
+| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession>): void10+ | Creates an AVSession. Only one AVSession can be created for a UIAbility.|
+| setAVMetadata(data: AVMetadata, callback: AsyncCallback<void>): void10+ | Sets AVSession metadata.|
+| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void>): void10+ | Sets the AVSession playback state.|
+| setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void>): void10+ | Starts a UIAbility.|
+| getController(callback: AsyncCallback<AVSessionController>): void10+ | Obtains the controller of the AVSession.|
+| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo>): void10+ | Obtains the output device information.|
+| activate(callback: AsyncCallback<void>): void10+ | Activates the AVSession.|
+| deactivate(callback: AsyncCallback<void>): void10+ | Deactivates this session.|
+| destroy(callback: AsyncCallback<void>): void10+ | Destroys the AVSession.|
| setAVQueueItems(items: Array<AVQueueItem>, callback: AsyncCallback<void>): void 10+ | Sets a playlist.|
| setAVQueueTitle(title: string, callback: AsyncCallback<void>): void10+ | Sets a name for the playlist.|
| dispatchSessionEvent(event: string, args: {[key: string]: Object}, callback: AsyncCallback<void>): void10+ | Dispatches a custom session event.|
@@ -343,21 +343,20 @@ To enable an audio and video application to access the AVSession service as a pr
session.off('commonCommand');
}
```
-
-
+
The code snippet below is used for destroying the AVSession object:
- ```ts
+ ```ts
async destroySession() {
- // It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet in step 1.
- let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION;
- // Destroy the AVSession object.
- session.destroy(function (err) {
- if (err) {
- console.error(`Failed to destroy session. Code: ${err.code}, message: ${err.message}`);
- } else {
- console.info(`Destroy : SUCCESS `);
- }
- });
+ // It is assumed that an AVSession object has been created. For details about how to create an AVSession object, see the node snippet in step 1.
+ let session: AVSessionManager.AVSession = ALREADY_CREATE_A_SESSION;
+ // Destroy the AVSession object.
+ session.destroy(function (err) {
+ if (err) {
+ console.error(`Failed to destroy session. Code: ${err.code}, message: ${err.message}`);
+ } else {
+ console.info(`Destroy : SUCCESS `);
+ }
+ });
}
- ```
\ No newline at end of file
+ ```
diff --git a/en/application-dev/napi/Readme-EN.md b/en/application-dev/napi/Readme-EN.md
index 1295e0798c8a2e98beace89c016828eac79d5a5a..2b1f8639a152589b76f44af97f9812a1a5711d23 100644
--- a/en/application-dev/napi/Readme-EN.md
+++ b/en/application-dev/napi/Readme-EN.md
@@ -1,7 +1,7 @@
# Native APIs
- [Introduction to Native APIs](introduction.md)
-- [Using N-APIs in Application Projects](napi-guidelines.md)
+- [Using Native APIs in Application Projects](napi-guidelines.md)
- [Drawing Development](drawing-guidelines.md)
- [Raw File Development](rawfile-guidelines.md)
- [Native Window Development](native-window-guidelines.md)
diff --git a/en/application-dev/napi/drawing-guidelines.md b/en/application-dev/napi/drawing-guidelines.md
index 22d85aec0fe405e47cd92abeafa94ba5e7b7ed5f..c341703ff86d6d0e3c6a34e8270e934b33a15d3a 100644
--- a/en/application-dev/napi/drawing-guidelines.md
+++ b/en/application-dev/napi/drawing-guidelines.md
@@ -128,10 +128,7 @@ The following steps describe how to use the canvas and brush of the Native Drawi
```c++
// Obtain the pixel address after drawing. The memory to which the address points contains the pixel data of the drawing on the canvas.
void* bitmapAddr = OH_Drawing_BitmapGetPixels(cBitmap);
- auto ret = memcpy_s(addr, addrSize, bitmapAddr, addrSize);
- if (ret != EOK) {
- LOGI("memcpy_s failed");
- }
+ std::copy(addr, addr + addrSize, static_cast(bitmapAddr));
// Destroy the canvas object.
OH_Drawing_CanvasDestroy(cCanvas);
// Destroy the bitmap object.
diff --git a/en/application-dev/napi/napi-guidelines.md b/en/application-dev/napi/napi-guidelines.md
index a12e23d9f48492911dff8476a1e5301736704d85..54ebab553f18ecaf21aae4e52b5a95e4bdfe1192 100644
--- a/en/application-dev/napi/napi-guidelines.md
+++ b/en/application-dev/napi/napi-guidelines.md
@@ -1,4 +1,4 @@
-# Using N-APIs in Application Projects
+# Using Native APIs in Application Projects
In OpenHarmony, you can use the N-APIs in C APIs to implement interaction between ArkTS/TS/JS and C/C++. The N-API names are the same as those in the third-party **Node.js**. Currently, OpenHarmony supports some N-APIs. For details about the APIs supported, see [arkui_napi](https://gitee.com/openharmony/arkui_napi/blob/master/libnapi.ndk.json).
diff --git a/en/application-dev/notification/Readme-EN.md b/en/application-dev/notification/Readme-EN.md
index f7b76df0e99484508bcb073462fd65f0ab3d03cb..47c6303ebec771590779b7cb9e5c3acaf6eaf31c 100644
--- a/en/application-dev/notification/Readme-EN.md
+++ b/en/application-dev/notification/Readme-EN.md
@@ -1,9 +1,9 @@
# Notification
- [Notification Overview](notification-overview.md)
-- [Notification Subscription (for System Applications Only)](notification-subscription.md)
+- [Subscribing to Notifications (for System Applications Only)](notification-subscription.md)
- [Enabling Notification](notification-enable.md)
-- [Notification Badge](notification-badge.md)
+- [Managing the Notification Badge](notification-badge.md)
- Publishing a Notification
- [Publishing a Basic Notification](text-notification.md)
- [Publishing a Progress Notification](progress-bar-notification.md)
diff --git a/en/application-dev/notification/notification-badge.md b/en/application-dev/notification/notification-badge.md
index 66d29e659d03ac147a9aa7acc0e1af24b60980c3..5cf38e460c8db944f8608869760e3dfc63c648a7 100644
--- a/en/application-dev/notification/notification-badge.md
+++ b/en/application-dev/notification/notification-badge.md
@@ -1,4 +1,4 @@
-# Notification Badge
+# Managing the Notification Badge
OpenHarmony provides APIs for setting the notification badge, which is displayed in the upper right corner of the application icon on the home screen to notify the user of the count of unread notifications.
@@ -11,11 +11,11 @@ After a notification is read, the count on the badge is decremented by 1. If the
1. The notification service provides two methods to increase the count on the notification badge:
- - When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest). After the notification is received, the count on the badge is incremented.
+ - When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest). After the notification is received, the count on the badge is incremented.
- - Call the [setBadgeNumber](../reference/apis/js-apis-notificationManager.md#setbadgenumber) API to set the count on the badge.
+ - Call the [setBadgeNumber()](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10) API to set the count on the badge.
-2. To decrease the count on the badge, call the **setBadgeNumber** API.
+2. To decrease the count on the badge, call the [setBadgeNumber()](../reference/apis/js-apis-notificationManager.md#notificationmanagersetbadgenumber10) API.
| API| Description|
| -------- | -------- |
@@ -32,37 +32,37 @@ After a notification is read, the count on the badge is decremented by 1. If the
2. Increase the count on the badge.
- When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-notificationManager.md#notificationrequest). For details, see [Publishing a Basic Notification](text-notification.md).
+ When publishing a notification, pass the **badgeNumber** parameter in [NotificationRequest](../reference/apis/js-apis-inner-notification-notificationRequest.md#notificationrequest). For details, see [Publishing a Basic Notification](text-notification.md).
In this example, the **setBadgeNumber** API is called to add a badge. This API is called after a new notification is published.
```ts
function setBadgeNumberCallback(err) {
- if (err) {
- console.info(`Set badge failed code is ${err.code}, message is ${err.message}`);
- } else {
- console.info(`Set badge success`);
- }
+ if (err) {
+ console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info(`Succeeded in seting badge number.`);
}
- let badgeNumber = 10
+ let badgeNumber = 10;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
```
-3. Reduce the count on the badge.
+3. Decrease the count on the badge.
After a notification is read, the application needs to call the API to set the number of remaining unread notifications. The badge is then updated.
```ts
function setBadgeNumberCallback(err) {
- if (err) {
- console.info(`Set badge failed code is ${err.code}, message is ${err.message}`);
- } else {
- console.info(`Set badge success`);
- }
+ if (err) {
+ console.error(`Failed to set badge number. Code is ${err.code}, message is ${err.message}`);
+ return;
+ }
+ console.info(`Succeeded in seting badge number.`);
}
- let badgeNumber = 9
+ let badgeNumber = 9;
notificationManager.setBadgeNumber(badgeNumber, setBadgeNumberCallback);
```
diff --git a/en/application-dev/notification/notification-subscription.md b/en/application-dev/notification/notification-subscription.md
index 45e75f1f64606cfa89cae2cfae91b89a13faaa5c..68bc11450b9302d66c05b3388ca8096e5c33088f 100644
--- a/en/application-dev/notification/notification-subscription.md
+++ b/en/application-dev/notification/notification-subscription.md
@@ -1,4 +1,4 @@
-# Notification Subscription (for System Applications Only)
+# Subscribing to Notifications (for System Applications Only)
To receive notifications, an application must subscribe to notifications first. The notification subsystem provides two types of subscription APIs, allowing applications to subscribe to notifications from all applications or notifications from a specific application.
@@ -13,14 +13,14 @@ The major APIs for notification subscription are described as follows. For detai
**Table 1** Major APIs for notification subscription
-| Name | Description|
+| API| Description|
| -------- | -------- |
| subscribe(subscriber: NotificationSubscriber, info: NotificationSubscribeInfo, callback: AsyncCallback<void>): void | Subscribes to notifications from a specific application.|
| subscribe(subscriber: NotificationSubscriber, callback: AsyncCallback<void>): void | Subscribes to notifications from all applications. |
**Table 2** Callbacks for notification subscription
-| Name | Description|
+| API| Description|
| -------- | -------- |
| onConsume?:(data: SubscribeCallbackData) => void | Callback for receiving notifications. |
| onCancel?:(data: SubscribeCallbackData) => void | Callback for canceling notifications. |
diff --git a/en/application-dev/notification/notification-with-wantagent.md b/en/application-dev/notification/notification-with-wantagent.md
index 638f53ef2f6f6fce1637468ba4c900496727f23d..3864db71c96b59827bdf4603f48199f27345a2a3 100644
--- a/en/application-dev/notification/notification-with-wantagent.md
+++ b/en/application-dev/notification/notification-with-wantagent.md
@@ -13,7 +13,7 @@ Below you can see the process of adding a **WantAgent** object to a notification
For details about the APIs, see [@ohos.app.ability.wantAgent](../reference/apis/js-apis-app-ability-wantAgent.md).
-| Name| Description|
+| API | Description|
| -------- | -------- |
| getWantAgent(info: WantAgentInfo, callback: AsyncCallback<WantAgent>): void | Creates a **WantAgent** object.|
| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback<CompleteData>): void | Triggers a **WantAgent** object.|
diff --git a/en/application-dev/quick-start/Readme-EN.md b/en/application-dev/quick-start/Readme-EN.md
index 631a5334c3fb783f84c4ca253f058fc386b6bc8d..3e8812f2a7ecfee12b8314572b563ce323a4ad1b 100644
--- a/en/application-dev/quick-start/Readme-EN.md
+++ b/en/application-dev/quick-start/Readme-EN.md
@@ -24,7 +24,7 @@
- [HAR](har-package.md)
- HSP
- [In-Application HSP Development](in-app-hsp.md)
- - [Inter-Application HSP Development (for System Applications Only)](cross-app-hsp.md)
+ - [Inter-Application HSP Development](cross-app-hsp.md)
- Atomic Service
- [Atomic Service Development](atomicService.md)
- [Atomic Service Space Management (for System Applications Only)](atomicService-aging.md)
diff --git a/en/application-dev/quick-start/application-package-structure-stage.md b/en/application-dev/quick-start/application-package-structure-stage.md
index 0736157fd42b4b6b6a2549e9262a7d25313aa452..2962c70242ad3bd558619fbbbbe755a86dae35c9 100644
--- a/en/application-dev/quick-start/application-package-structure-stage.md
+++ b/en/application-dev/quick-start/application-package-structure-stage.md
@@ -4,7 +4,7 @@
To develop an application based on the [stage model](application-configuration-file-overview-stage.md), it will be helpful if you have a basic understanding of the structure of the application package created after the application is built and packaged, as well as the related basic concepts.
-- In development, an application contains one or more modules. You can [create modules](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/ohos-adding-deleting-module-0000001218760594-V3) in the application project in [DevEco Studio](https://developer.harmonyos.com/en/develop/deveco-studio/). As a basic functional unit of an OpenHarmony application/service, a module contains source code, resource files, third-party libraries, and application/service configuration files, and can be built and run independently. Modules can be classified as Ability or Library. A module of the Ability type is built into a Harmony Ability Package (HAP) file, and a module of the Library type is built into a [Harmony Archive (HAR)](har-package.md) file or a [Harmony Shared Package (HSP)](shared-guide.md).
+- In development, an application contains one or more modules. You can [create modules](https://developer.harmonyos.com/en/docs/documentation/doc-guides-V3/add_new_module-0000001053223741-V3) in the application project in [DevEco Studio](https://developer.harmonyos.com/en/develop/deveco-studio/). As a basic functional unit of an OpenHarmony application/service, a module contains source code, resource files, third-party libraries, and application/service configuration files, and can be built and run independently. Modules can be classified as Ability or Library. A module of the Ability type is built into a Harmony Ability Package (HAP) file, and a module of the Library type is built into a [Harmony Archive (HAR)](har-package.md) file or a [Harmony Shared Package (HSP)](shared-guide.md).
A module can contain one or more [UIAbility](../application-models/uiability-overview.md) components, as shown in the figure below.
**Figure 1** Relationship between modules and UIAbility components
diff --git a/en/application-dev/quick-start/arkts-two-way-sync.md b/en/application-dev/quick-start/arkts-two-way-sync.md
index ee6f1a6be51054893ed11686cb92a192b850c730..25acb5741b55ed121950726455f9b3bfce183d29 100644
--- a/en/application-dev/quick-start/arkts-two-way-sync.md
+++ b/en/application-dev/quick-start/arkts-two-way-sync.md
@@ -1,4 +1,4 @@
-# $ Syntax: Two-Way Synchronization of Built-in Components
+# $$ Syntax: Two-Way Synchronization of Built-in Components
The $$ operator provides a TS variable by-reference to a built-in component so that the variable value and the internal state of that component are kept in sync.
diff --git a/en/application-dev/quick-start/module-configuration-file.md b/en/application-dev/quick-start/module-configuration-file.md
index ac141ad75d108f68d25007491a15062ae958563e..f9a2bae37b168a476bc6729db3565eb0c10756a9 100644
--- a/en/application-dev/quick-start/module-configuration-file.md
+++ b/en/application-dev/quick-start/module-configuration-file.md
@@ -226,7 +226,7 @@ The **metadata** tag represents the custom metadata of the HAP file. The tag val
## abilities
-UIAbility configuration of the module, which is valid only for the current UIAbility component.
+The **abilities** tag represents the UIAbility configuration of the module, which is valid only for the current UIAbility component.
**By default, application icons cannot be hidden from the home screen in OpenHarmony.**
@@ -242,7 +242,7 @@ This requirement on application icons is intended to prevent malicious applicati
**Setting the application icon to be displayed on the home screen**:
-Set **icon**, **label**, and **skills** under **abilities** in the **module.json5** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
+Set **icon**, **label**, and **skills** under **abilities** in the **module.json5** file. Make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
```
{
diff --git a/en/application-dev/quick-start/module-structure.md b/en/application-dev/quick-start/module-structure.md
index 2959e6a942a6236a1717d9f2ead60dc7f814e479..b155d24ed6d4d22307c37a3374542b8283d1f352 100644
--- a/en/application-dev/quick-start/module-structure.md
+++ b/en/application-dev/quick-start/module-structure.md
@@ -205,7 +205,7 @@ This requirement on application icons is intended to prevent malicious applicati
**Setting the application icon to be displayed on the home screen**:
-Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. In addition, make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
+Set **icon**, **label**, and **skills** under **abilities** in the **config.json** file. Make sure the **skills** configuration contains **ohos.want.action.home** and **entity.system.home**.
```
{
diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md
index f9a6af9e1de4ac19c1623914fcd7e6a62c41a3fd..8b122dde9179dc70c4caba012a1c23b5cc8d3919 100644
--- a/en/application-dev/reference/apis/Readme-EN.md
+++ b/en/application-dev/reference/apis/Readme-EN.md
@@ -210,6 +210,9 @@
- [@ohos.multimedia.camera (Camera Management)](js-apis-camera.md)
- [@ohos.multimedia.image (Image Processing)](js-apis-image.md)
- [@ohos.multimedia.media (Media)](js-apis-media.md)
+ - [@ohos.multimedia.systemSoundManager (System Sound Management)](js-apis-systemSoundManager.md)
+ - multimedia
+ - [ringtonePlayer (Ringtone Player)](js-apis-inner-multimedia-ringtonePlayer.md)
- Resource Manager
- [@ohos.i18n (Internationalization)](js-apis-i18n.md)
@@ -238,6 +241,7 @@
- [PermissionRequestResult](js-apis-permissionrequestresult.md)
- Data Management
+ - [@ohos.data.cloudData (Device-Cloud Synergy)](js-apis-data-cloudData.md)
- [@ohos.data.dataAbility (DataAbility Predicates)](js-apis-data-ability.md)
- [@ohos.data.dataShare (DataShare)](js-apis-data-dataShare.md)
- [@ohos.data.dataSharePredicates (DataShare Predicates)](js-apis-data-dataSharePredicates.md)
@@ -319,6 +323,7 @@
- [@ohos.InputMethodExtensionAbility (InputMethodExtensionAbility)](js-apis-inputmethod-extension-ability.md)
- [@ohos.InputMethodExtensionContext (InputMethodExtensionContext)](js-apis-inputmethod-extension-context.md)
- [@ohos.InputMethodSubtype (Input Method Subtype)](js-apis-inputmethod-subtype.md)
+ - [@ohos.logLibrary (Log Library)](js-apis-loglibrary.md)
- [@ohos.pasteboard (Pasteboard)](js-apis-pasteboard.md)
- [@ohos.screenLock (Screenlock)](js-apis-screen-lock.md)
- [@ohos.systemDateTime (System Time and Time Zone)](js-apis-system-date-time.md)
diff --git a/en/application-dev/reference/apis/common_event/Readme-EN.md b/en/application-dev/reference/apis/common_event/Readme-EN.md
index 9c61482c2e615aa50161c5482c8c46bb91027d1a..adae88f06be7be491c51e03e795a22031b170e33 100644
--- a/en/application-dev/reference/apis/common_event/Readme-EN.md
+++ b/en/application-dev/reference/apis/common_event/Readme-EN.md
@@ -3,6 +3,7 @@
- [Common Events of the Ability Subsystem](commonEvent-ability.md)
- [Common Events of the Bundle Management Subsystem](commonEvent-bundleManager.md)
- [Common Events of the Notification Service](commonEvent-ans.md)
-- [Common Events of the Resource Scheduling Subsystem](commonEvent-resourceschedule.md)
+- [Common Events of the Resource Scheduler Subsystem](commonEvent-resourceschedule.md)
- [Common Events of the Telephony Subsystem](commonEvent-telephony.md)
- [Common Events of the USB Subsystem](commonEvent-usb.md)
+
diff --git a/en/application-dev/reference/apis/common_event/commonEvent-resourceschedule.md b/en/application-dev/reference/apis/common_event/commonEvent-resourceschedule.md
index 41e7e2adae16d45e83fc527010939bdb5cfe119c..191c38c2d5896caccbd688e43db37a0301ed0c3c 100644
--- a/en/application-dev/reference/apis/common_event/commonEvent-resourceschedule.md
+++ b/en/application-dev/reference/apis/common_event/commonEvent-resourceschedule.md
@@ -1,5 +1,5 @@
-# Common Events of the Resource Scheduling Subsystem
-This document lists the common system events provided by the resource scheduling subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events.
+# Common Events of the Resource Scheduler Subsystem
+This document lists the common system events provided by the resource scheduler subsystem to applications. Applications can use [APIs](../js-apis-commonEventManager.md) to subscribe to common system events.
## COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED
Indicates that the system idle mode has changed.
diff --git a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
index 86b80960d6de170eb7def9e9bfcc88aa8913c7ad..ffedb677c4743434e3c860a6d56b7af5d19be500 100644
--- a/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
+++ b/en/application-dev/reference/apis/js-apis-abilityAccessCtrl.md
@@ -64,7 +64,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
@@ -74,7 +74,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
try {
- atManager.checkAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS").then((data) => {
+ atManager.checkAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS').then((data) => {
console.log(`checkAccessToken success, data->${JSON.stringify(data)}`);
}).catch((err) => {
console.log(`checkAccessToken fail, err->${JSON.stringify(err)}`);
@@ -111,14 +111,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
```js
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let data = atManager.verifyAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let data = atManager.verifyAccessTokenSync(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
console.log(`data->${JSON.stringify(data)}`);
```
@@ -154,7 +154,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName is greater than 256 bytes, or the flags value is invalid. |
+| 12100001 | The parameter is invalid. The tokenID is 0, the permissionName exceeds 256 bytes, or the flags value is invalid. |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The application specified by the tokenID is not allowed to be granted with the specified permission. Either the application is a sandbox or the tokenID is from a remote device. |
@@ -169,7 +169,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags).then(() => {
+ atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags).then(() => {
console.log('grantUserGrantedPermission success');
}).catch((err) => {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
@@ -221,7 +221,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.grantUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags, (err, data) => {
+ atManager.grantUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags, (err, data) => {
if (err) {
console.log(`grantUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else {
@@ -280,7 +280,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags).then(() => {
+ atManager.revokeUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags).then(() => {
console.log('revokeUserGrantedPermission success');
}).catch((err) => {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
@@ -332,7 +332,7 @@ let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
let permissionFlags = 1;
try {
- atManager.revokeUserGrantedPermission(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", permissionFlags, (err, data) => {
+ atManager.revokeUserGrantedPermission(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS', permissionFlags, (err, data) => {
if (err) {
console.log(`revokeUserGrantedPermission fail, err->${JSON.stringify(err)}`);
} else {
@@ -375,7 +375,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100002 | The specified tokenID does not exist. |
| 12100003 | The specified permission does not exist. |
| 12100006 | The operation is not allowed. Either the application is a sandbox or the tokenID is from a remote device. |
@@ -389,7 +389,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
try {
- atManager.getPermissionFlags(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS").then((data) => {
+ atManager.getPermissionFlags(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS').then((data) => {
console.log(`getPermissionFlags success, data->${JSON.stringify(data)}`);
}).catch((err) => {
console.log(`getPermissionFlags fail, err->${JSON.stringify(err)}`);
@@ -443,7 +443,7 @@ Subscribes to permission state changes of the specified applications and permiss
| ------------------ | --------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type to subscribe to. The value is **'permissionStateChange'**, which indicates the permission grant state change. |
| tokenIDList | Array<number> | Yes | Token IDs of the applications to observe. If this parameter is left empty, the permission grant state changes of all applications are observed. |
-| permissionList | Array<Permissions> | Yes | Permissions to observe. If this parameter is left empty, the grant state changes of all permissions are observed. |
+| permissionList | Array<Permissions> | Yes | List of permission names. If this parameter is left empty, the grant state changes of all permissions are subscribed to. |
| callback | Callback<[PermissionStateChangeInfo](#permissionstatechangeinfo9)> | Yes| Callback invoked to return the permission grant state change.|
**Error codes**
@@ -452,7 +452,7 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
| 12100004 | The interface is called repeatedly with the same input. |
| 12100005 | The registration time has exceeded the limitation. |
| 12100007 | Service is abnormal. |
@@ -461,16 +461,16 @@ For details about the error codes, see [Application Access Control Error Codes](
**Example**
```js
-import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl';
+import {Permissions} from '@ohos.abilityAccessCtrl';
import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array = [appInfo.accessTokenId];
-let permissionList: Array = ["ohos.permission.DISTRIBUTED_DATASYNC"];
+let permissionList: Array = ['ohos.permission.DISTRIBUTED_DATASYNC'];
try {
atManager.on('permissionStateChange', tokenIDList, permissionList, (data) => {
- console.debug("receive permission state change, data:" + JSON.stringify(data));
+ console.debug('receive permission state change, data:' + JSON.stringify(data));
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -505,20 +505,20 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
| 12100001 | The parameter is invalid. The tokenIDs or permissionNames in the list are all invalid. |
-| 12100004 | The interface is not used together with "on". |
+| 12100004 | The interface is not used together with 'on'. |
| 12100007 | Service is abnormal. |
| 12100008 | Out of memory. |
**Example**
```js
-import abilityAccessCtrl, {Permissions} from '@ohos.abilityAccessCtrl';
+import {Permissions} from '@ohos.abilityAccessCtrl';
import bundleManager from '@ohos.bundle.bundleManager';
let atManager = abilityAccessCtrl.createAtManager();
let appInfo = bundleManager.getApplicationInfoSync('com.example.myapplication', 0, 100);
let tokenIDList: Array = [appInfo.accessTokenId];
-let permissionList: Array = ["ohos.permission.DISTRIBUTED_DATASYNC"];
+let permissionList: Array = ['ohos.permission.DISTRIBUTED_DATASYNC'];
try {
atManager.off('permissionStateChange', tokenIDList, permissionList);
} catch(err) {
@@ -558,7 +558,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let promise = atManager.verifyAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let promise = atManager.verifyAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
promise.then(data => {
console.log(`promise: data->${JSON.stringify(data)}`);
});
@@ -599,10 +599,10 @@ For details about the error codes, see [Application Access Control Error Codes](
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
- atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"], (err, data)=>{
- console.info("data:" + JSON.stringify(data));
- console.info("data permissions:" + data.permissions);
- console.info("data authResults:" + data.authResults);
+ atManager.requestPermissionsFromUser(this.context, ['ohos.permission.CAMERA'], (err, data)=>{
+ console.info('data:' + JSON.stringify(data));
+ console.info('data permissions:' + data.permissions);
+ console.info('data authResults:' + data.authResults);
});
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -650,12 +650,12 @@ For details about the error codes, see [Application Access Control Error Codes](
import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
try {
- atManager.requestPermissionsFromUser(this.context, ["ohos.permission.CAMERA"]).then((data) => {
- console.info("data:" + JSON.stringify(data));
- console.info("data permissions:" + data.permissions);
- console.info("data authResults:" + data.authResults);
+ atManager.requestPermissionsFromUser(this.context, ['ohos.permission.CAMERA']).then((data) => {
+ console.info('data:' + JSON.stringify(data));
+ console.info('data permissions:' + data.permissions);
+ console.info('data authResults:' + data.authResults);
}).catch((err) => {
- console.info("data:" + JSON.stringify(err));
+ console.info('data:' + JSON.stringify(err));
})
} catch(err) {
console.log(`catch err->${JSON.stringify(err)}`);
@@ -694,7 +694,7 @@ import abilityAccessCtrl from '@ohos.abilityAccessCtrl';
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let promise = atManager.verifyAccessToken(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let promise = atManager.verifyAccessToken(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
promise.then(data => {
console.log(`promise: data->${JSON.stringify(data)}`);
});
@@ -727,14 +727,14 @@ For details about the error codes, see [Application Access Control Error Codes](
| ID| Error Message|
| -------- | -------- |
-| 12100001 | The parameter is invalid. The tokenID is 0 or the permissionName exceeds 256 bytes. |
+| 12100001 | The parameter is invalid. The tokenID is 0, or the permissionName exceeds 256 bytes. |
**Example**
```js
let atManager = abilityAccessCtrl.createAtManager();
let tokenID = 0; // Use bundleManager.getApplicationInfo() to obtain the token ID for a system application, and use bundleManager.getBundleInfoForSelf() to obtain the token ID for a non-system application.
-let data = atManager.checkAccessTokenSync(tokenID, "ohos.permission.GRANT_SENSITIVE_PERMISSIONS");
+let data = atManager.checkAccessTokenSync(tokenID, 'ohos.permission.GRANT_SENSITIVE_PERMISSIONS');
console.log(`data->${JSON.stringify(data)}`);
```
diff --git a/en/application-dev/reference/apis/js-apis-accessibility-config.md b/en/application-dev/reference/apis/js-apis-accessibility-config.md
index 673d820d17407a35991da01b0b25ee48cd51c7eb..09fb6c49bf265b0a4ef22ddd38dc46370097304d 100644
--- a/en/application-dev/reference/apis/js-apis-accessibility-config.md
+++ b/en/application-dev/reference/apis/js-apis-accessibility-config.md
@@ -247,7 +247,7 @@ Cancels the listener for changes in the list of enabled accessibility extension
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Listening type. The value is fixed at **'enabledAccessibilityExtensionListChange'**, indicating listening for changes in the list of enabled accessibility extension abilities.|
-| callback | Callback<void> | No| Callback invoked when the list of enabled accessibility extension abilities changes.|
+| callback | Callback<void> | No| Callback for the event.|
**Example**
@@ -425,7 +425,7 @@ Cancels the listener for attribute changes. This API uses an asynchronous callba
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| callback | Callback<T> | No| Callback invoked when the list of enabled accessibility extension abilities changes.|
+| callback | Callback<T> | No| Callback for the event.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-accessibility.md b/en/application-dev/reference/apis/js-apis-accessibility.md
index 0b00bbfdf4c7c50ae3ffbd0d0fd1cc6effdb2f7d..2f92eaaf3052bd34f76baefc6a04de7a8d59b4a4 100644
--- a/en/application-dev/reference/apis/js-apis-accessibility.md
+++ b/en/application-dev/reference/apis/js-apis-accessibility.md
@@ -18,9 +18,9 @@ Enumerates the states of an accessibility application.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| enable | The accessibility application is enabled.|
+| Name | Description |
+| ------- | -------- |
+| enable | The accessibility application is enabled.|
| disable | The accessibility application is disabled.|
| install | The accessibility application has been installed.|
@@ -30,13 +30,13 @@ Enumerates the types of accessibility applications.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| audible | The accessibility application provides audible feedback.|
-| generic | The accessibility application provides generic feedback.|
-| haptic | The accessibility application provides haptic feedback.|
-| spoken | The accessibility application provides spoken feedback.|
-| visual | The accessibility application provides visual feedback.|
+| Name | Description |
+| ---------------- | --------- |
+| audible | The accessibility application provides audible feedback.|
+| generic | The accessibility application provides generic feedback.|
+| haptic | The accessibility application provides haptic feedback.|
+| spoken | The accessibility application provides spoken feedback.|
+| visual | The accessibility application provides visual feedback.|
| all9+ | All the preceding types.|
## AccessibilityAbilityInfo
@@ -47,16 +47,16 @@ Provides information about an accessibility application.
### Attributes
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| id | string | Yes| No| Ability ID.|
-| name | string | Yes| No| Ability name.|
-| bundleName | string | Yes| No| Bundle name.|
-| targetBundleNames9+ | Array<string> | Yes| No| Name of the target bundle.|
-| abilityTypes | Array<[AbilityType](#abilitytype)> | Yes| No| Accessibility application type.|
-| capabilities | Array<[Capability](#capability)> | Yes| No| Capabilities list of the accessibility application.|
-| description | string | Yes| No| Description of the accessibility application.|
-| eventTypes | Array<[EventType](#eventtype)> | Yes| No| List of events that the accessibility application focuses on.|
+| Name | Type | Readable | Writable | Description |
+| ------------------------------ | ---------------------------------------- | ---- | ---- | ---------------- |
+| id | string | Yes | No | Ability ID.|
+| name | string | Yes | No | Ability name. |
+| bundleName | string | Yes | No | Bundle name. |
+| targetBundleNames9+ | Array<string> | Yes | No | Name of the target bundle. |
+| abilityTypes | Array<[AbilityType](#abilitytype)> | Yes | No | Accessibility application type. |
+| capabilities | Array<[Capability](#capability)> | Yes | No | Capabilities list of the accessibility application. |
+| description | string | Yes | No | Description of the accessibility application. |
+| eventTypes | Array<[EventType](#eventtype)> | Yes | No | List of events that the accessibility application focuses on. |
## Action
@@ -64,24 +64,24 @@ Describes the target action supported by an accessibility application.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| click | Clicking.|
-| longClick | Long pressing.|
-| scrollForward | Scrolling forward. Not supported currently. |
-| scrollBackward | Scrolling backward. Not supported currently. |
-| focus | Obtaining focus. Not supported currently. |
-| clearFocus | Clearing focus. Not supported currently. |
-| clearSelection | Clearing selection. Not supported currently. |
-| accessibilityFocus | Obtaining the accessibility focus. |
-| clearAccessibilityFocus | Clearing the accessibility focus. |
-| cut | Cut. Not supported currently. |
-| copy | Copy. Not supported currently. |
-| paste | Paste. Not supported currently. |
-| select | Select. Not supported currently. |
-| setText | Setting the text. Not supported currently. |
-| delete | Delete. Not supported currently. |
-| setSelection | Setting the selection. Not supported currently. |
+| Name | Description |
+| ----------------------- | ------------------ |
+| click | Clicking. |
+| longClick | Long pressing. |
+| scrollForward | Scrolling forward. Not supported currently.|
+| scrollBackward | Scrolling backward. Not supported currently.|
+| focus | Obtaining focus. Not supported currently.|
+| clearFocus | Clearing focus. Not supported currently.|
+| clearSelection | Clearing selection. Not supported currently.|
+| accessibilityFocus | Obtaining the accessibility focus. |
+| clearAccessibilityFocus | Clearing the accessibility focus. |
+| cut | Cut. Not supported currently. |
+| copy | Copy. Not supported currently. |
+| paste | Paste. Not supported currently. |
+| select | Select. Not supported currently. |
+| setText | Setting the text. Not supported currently.|
+| delete | Delete. Not supported currently. |
+| setSelection | Setting the selection. Not supported currently. |
## Capability
@@ -89,13 +89,13 @@ Enumerates the capabilities of an accessibility application.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| retrieve | Capability to retrieve the window content.|
-| touchGuide | Capability of touch guide mode.|
-| keyEventObserver | Capability to filter key events.|
-| zoom | Capability to control the display zoom level. Not supported currently. |
-| gesture | Capability to perform gesture actions.|
+| Name | Description |
+| ---------------- | --------------------- |
+| retrieve | Capability to retrieve the window content. |
+| touchGuide | Capability of touch guide mode. |
+| keyEventObserver | Capability to filter key events. |
+| zoom | Capability to control the display zoom level. Not supported currently.|
+| gesture | Capability to perform gesture actions. |
## CaptionsFontEdgeType8+
@@ -103,12 +103,12 @@ Enumerates the font edge types of captions.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
-| Name| Description|
-| -------- | -------- |
-| none | No effect.|
-| raised | Raised effect.|
-| depressed | Depressed effect.|
-| uniform | Uniform effect.|
+| Name | Description |
+| ---------- | ----- |
+| none | No effect. |
+| raised | Raised effect.|
+| depressed | Depressed effect.|
+| uniform | Uniform effect.|
| dropShadow | Drop shadow effect.|
## CaptionsFontFamily8+
@@ -117,16 +117,16 @@ Enumerates the font families of captions.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
-| Name| Description|
-| -------- | -------- |
-| default | Default font family.|
-| monospacedSerif | Monospaced Serif fonts, which use the same width for each character.|
-| serif | Serif fonts.|
+| Name | Description |
+| ------------------- | ----------------- |
+| default | Default font family. |
+| monospacedSerif | Monospaced Serif fonts, which use the same width for each character. |
+| serif | Serif fonts. |
| monospacedSansSerif | Monospaced Sans Serif fonts, which use the same width for each character.|
-| sansSerif | Sans Serif fonts.|
-| casual | Casual fonts.|
-| cursive | Cursive fonts.|
-| smallCapitals | Small caps fonts.|
+| sansSerif | Sans Serif fonts. |
+| casual | Casual fonts. |
+| cursive | Cursive fonts. |
+| smallCapitals | Small caps fonts. |
## CaptionsStyle8+
@@ -134,14 +134,14 @@ Describes the style of captions.
**System capability**: SystemCapability.BarrierFree.Accessibility.Hearing
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes| No| Font family of captions.|
-| fontScale | number | Yes| No| Font scale of captions.|
-| fontColor | number \| string | Yes| No| Font color of captions.|
-| fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes| No| Font edge type of captions.|
-| backgroundColor | number \| string | Yes| No| Background color of captions.|
-| windowColor | number \| string | Yes| No| Window color of captions.|
+| Name | Type | Readable | Writable | Description |
+| --------------- | ---------------------------------------- | ---- | ---- | ----------- |
+| fontFamily | [CaptionsFontFamily](#captionsfontfamily8) | Yes | No | Font family of captions. |
+| fontScale | number | Yes | No | Font scale of captions.|
+| fontColor | number \| string | Yes | No | Font color of captions. |
+| fontEdgeType | [CaptionsFontEdgeType](#captionsfontedgetype8) | Yes | No | Font edge type of captions. |
+| backgroundColor | number \| string | Yes | No | Background color of captions. |
+| windowColor | number \| string | Yes | No | Window color of captions. |
## CaptionsManager8+
@@ -151,10 +151,10 @@ Implements configuration management for captions. Before calling any API of **Ca
### Attributes
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| enabled | boolean | Yes| No| Whether to enable captions configuration.|
-| style | [CaptionsStyle](#captionsstyle8) | Yes| No| Style of captions.|
+| Name | Type | Readable | Writable | Description |
+| ------- | -------------------------------- | ---- | ---- | ----------- |
+| enabled | boolean | Yes | No | Whether to enable captions configuration.|
+| style | [CaptionsStyle](#captionsstyle8) | Yes | No | Style of captions. |
### on('enableChange')
@@ -164,10 +164,10 @@ Enables listening for the enabled status changes of captions configuration. This
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Type of the event to listen for, which is set to **'enableChange'** in this API.|
-| callback | Callback<boolean> | Yes| Callback invoked when the enabled status of captions configuration changes.|
+| Name | Type | Mandatory | Description |
+| -------- | ----------------------- | ---- | --------------------------------------- |
+| type | string | Yes | Type of the event to listen for, which is set to **'enableChange'** in this API.|
+| callback | Callback<boolean> | Yes | Callback invoked when the enabled status of captions configuration changes. |
**Example**
@@ -190,10 +190,10 @@ Enables listening for captions style changes. This API uses an asynchronous call
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Type of the event to listen for, which is set to **'styleChange'** in this API.|
-| callback | Callback<[CaptionsStyle](#captionsstyle8)> | Yes| Callback invoked when the style of captions changes.|
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------------------- | ---- | ---------------------------------- |
+| type | string | Yes | Type of the event to listen for, which is set to **'styleChange'** in this API.|
+| callback | Callback<[CaptionsStyle](#captionsstyle8)> | Yes | Callback invoked when the style of captions changes. |
**Example**
@@ -218,10 +218,10 @@ Disables listening for the enabled status changes of captions configuration. Thi
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Type of the event to listen for, which is set to **'enableChange'** in this API.|
-| callback | Callback<boolean> | No| Callback invoked when the enabled status of captions configuration changes.|
+| Name | Type | Mandatory | Description |
+| -------- | ----------------------- | ---- | ---------------------------------------- |
+| type | string | Yes | Type of the event to listen for, which is set to **'enableChange'** in this API.|
+| callback | Callback<boolean> | No | Callback for the event. |
**Example**
@@ -244,10 +244,10 @@ Disables listening for captions style changes. This API uses an asynchronous cal
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Type of the event to listen for, which is set to **'styleChange'** in this API.|
-| callback | Callback<[CaptionsStyle](#captionsstyle8)> | No| Callback invoked when the style of captions changes.|
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------------------- | ---- | ------------------------------------ |
+| type | string | Yes | Type of the event to listen for, which is set to **'styleChange'** in this API.|
+| callback | Callback<[CaptionsStyle](#captionsstyle8)> | No | Callback for the event. |
**Example**
@@ -272,22 +272,22 @@ Describes a GUI change event.
### Attributes
-| Name| Type| Readable| Writable| Description|
-| -------- | -------- | -------- | -------- | -------- |
-| type | [EventType](#eventtype) | Yes| Yes| Accessibility event type.|
-| windowUpdateType | [WindowUpdateType](#windowupdatetype) | Yes| Yes| Window update type.|
-| bundleName | string | Yes| Yes| Target application name.|
-| componentType | string | Yes| Yes| Type of the event source component, for example, button or chart.|
-| pageId | number | Yes| Yes| Page ID of the event source.|
-| description | string | Yes| Yes| Event description. Not supported currently. |
-| triggerAction | [Action](#action) | Yes| Yes| Action that triggers the event.|
-| textMoveUnit | [TextMoveUnit](#textmoveunit) | Yes| Yes| Text movement unit. Not supported currently. |
-| contents | Array<string> | Yes| Yes| Array of contents.|
-| lastContent | string | Yes| Yes| Latest content.|
-| beginIndex | number | Yes| Yes| Sequence number of the first item displayed on the page. Not supported currently. |
-| currentIndex | number | Yes| Yes| Sequence number of the current item. Not supported currently. |
-| endIndex | number | Yes| Yes| Sequence number of the last item displayed on the page. Not supported currently. |
-| itemCount | number | Yes| Yes| Total number of items. Not supported currently. |
+| Name | Type | Readable | Writable | Description |
+| ---------------- | ------------------------------------- | ---- | ---- | --------------------- |
+| type | [EventType](#eventtype) | Yes | Yes | Accessibility event type. |
+| windowUpdateType | [WindowUpdateType](#windowupdatetype) | Yes | Yes | Window update type. |
+| bundleName | string | Yes | Yes | Target application name. |
+| componentType | string | Yes | Yes | Type of the event source component, for example, button or chart. |
+| pageId | number | Yes | Yes | Page ID of the event source. |
+| description | string | Yes | Yes | Event description. Not supported currently. |
+| triggerAction | [Action](#action) | Yes | Yes | Action that triggers the event. |
+| textMoveUnit | [TextMoveUnit](#textmoveunit) | Yes | Yes | Text movement unit. Not supported currently. |
+| contents | Array<string> | Yes | Yes | Array of contents. |
+| lastContent | string | Yes | Yes | Latest content. |
+| beginIndex | number | Yes | Yes | Sequence number of the first item displayed on the page. Not supported currently.|
+| currentIndex | number | Yes | Yes | Sequence number of the current item. Not supported currently. |
+| endIndex | number | Yes | Yes | Sequence number of the last item displayed on the page. Not supported currently.|
+| itemCount | number | Yes | Yes | Total number of items. Not supported currently. |
### constructor
@@ -299,9 +299,9 @@ Implements a constructor.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| jsonObject | string | Yes| JSON string required for creating an object.|
+| Name | Type | Mandatory | Description |
+| ---------- | ------ | ---- | -------------------- |
+| jsonObject | string | Yes | JSON string required for creating an object.|
**Example**
@@ -319,19 +319,19 @@ Enumerates accessibility event types.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| click | Event of clicking a component.|
-| longClick | Event of long-pressing a component.|
-| select | Event of selecting a component. Not supported currently. |
-| focus | Event indicating that the component obtains the focus. Not supported currently. |
-| textUpdate | Event indicating that the component text has been updated. Not supported currently. |
-| hoverEnter | Event indicating that the hover enters a component. Not supported currently. |
-| hoverExit | Event indicating that the hover exits a component. Not supported currently. |
-| scroll | Event of the scroll view. Not supported currently. |
-| textSelectionUpdate | Event indicating that the selected text has been updated. Not supported currently. |
-| accessibilityFocus | Event indicating that the accessibility focus has been obtained.|
-| accessibilityFocusClear | Event indicating that the accessibility focus has been cleared.|
+| Name | Description |
+| ----------------------- | ---------------------- |
+| click | Event of clicking a component. |
+| longClick | Event of long-pressing a component. |
+| select | Event of selecting a component. Not supported currently. |
+| focus | Event indicating that the component obtains the focus. Not supported currently. |
+| textUpdate | Event indicating that the component text has been updated. Not supported currently.|
+| hoverEnter | Event indicating that the hover enters a component. Not supported currently. |
+| hoverExit | Event indicating that the hover exits a component. Not supported currently. |
+| scroll | Event of the scroll view. Not supported currently. |
+| textSelectionUpdate | Event indicating that the selected text has been updated. Not supported currently.|
+| accessibilityFocus | Event indicating that the accessibility focus has been obtained. |
+| accessibilityFocusClear | Event indicating that the accessibility focus has been cleared. |
## TextMoveUnit
@@ -339,12 +339,12 @@ Enumerates the movement units for traversing the node text.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| char | The movement unit for traversing the node text is by character.|
-| word | The movement unit for traversing the node text is by word.|
-| line | The movement unit for traversing the node text is by line.|
-| page | The movement unit for traversing the node text is by page.|
+| Name | Description |
+| --------- | --------------- |
+| char | The movement unit for traversing the node text is by character.|
+| word | The movement unit for traversing the node text is by word. |
+| line | The movement unit for traversing the node text is by line. |
+| page | The movement unit for traversing the node text is by page. |
| paragraph | The movement unit for traversing the node text is by paragraph.|
## WindowUpdateType
@@ -353,13 +353,13 @@ Enumerates window update types.
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
-| Name| Description|
-| -------- | -------- |
-| add | Window adding.|
-| remove | Window deletion.|
-| bounds | Window boundary change.|
+| Name | Description |
+| ------ | ------------------ |
+| add | Window adding. |
+| remove | Window deletion. |
+| bounds | Window boundary change. |
| active | Window activity change.|
-| focus | Window focus change.|
+| focus | Window focus change. |
## accessibility.getAbilityLists(deprecated)
@@ -370,21 +370,21 @@ Obtains the accessibility application list. This API uses a promise to return th
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9.
-> You are advised to use [getAccessibilityExtensionList()](#accessibilitygetaccessibilityextensionlist9).
+> You are advised to use[getAccessibilityExtensionList()](#accessibilitygetaccessibilityextensionlist9).
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
-| stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
+| Name | Type | Mandatory | Description |
+| ----------- | ----------------------------- | ---- | -------- |
+| abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type.|
+| stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status.|
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ---------------------------------------- | --------------------- |
| Promise<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Promise used to return the accessibility application list.|
**Example**
@@ -426,11 +426,11 @@ Obtains the accessibility application list. This API uses an asynchronous callba
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
-| stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
-| callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes| Callback used to return the accessibility application list.|
+| Name | Type | Mandatory | Description |
+| ----------- | ---------------------------------------- | ---- | ---------------- |
+| abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type. |
+| stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status. |
+| callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes | Callback used to return the accessibility application list.|
**Example**
@@ -470,15 +470,15 @@ Obtains the accessibility application list. This API uses a promise to return th
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
-| stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
+| Name | Type | Mandatory | Description |
+| ----------- | ----------------------------- | ---- | -------- |
+| abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type.|
+| stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status.|
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ---------------------------------------- | --------------------- |
| Promise<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Promise used to return the accessibility application list.|
**Example**
@@ -515,11 +515,11 @@ Obtains the accessibility application list. This API uses an asynchronous callba
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| abilityType | [AbilityType](#abilitytype) | Yes| Accessibility application type.|
-| stateType | [AbilityState](#abilitystate) | Yes| Accessibility application status.|
-| callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes| Callback used to return the accessibility application list.|
+| Name | Type | Mandatory | Description |
+| ----------- | ---------------------------------------- | ---- | ---------------- |
+| abilityType | [AbilityType](#abilitytype) | Yes | Accessibility application type. |
+| stateType | [AbilityState](#abilitystate) | Yes | Accessibility application status. |
+| callback | AsyncCallback<Array<[AccessibilityAbilityInfo](#accessibilityabilityinfo)>> | Yes | Callback used to return the accessibility application list.|
**Example**
@@ -557,8 +557,8 @@ Obtains a **CaptionsManager** instance.
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ------------------------------------ | ---------- |
| [CaptionsManager](#captionsmanager8) | Captions configuration.|
**Example**
@@ -577,10 +577,10 @@ Enables listening for the enabled status changes of the accessibility applicatio
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Type of the event to listen for, which is set to **'accessibilityStateChange'** in this API.|
-| callback | Callback<boolean> | Yes| Callback used to return the result.|
+| Name | Type | Mandatory | Description |
+| -------- | ----------------------- | ---- | ---------------------------------------- |
+| type | string | Yes | Type of the event to listen for, which is set to **'accessibilityStateChange'** in this API.|
+| callback | Callback<boolean> | Yes | Callback used to return the result. |
**Example**
@@ -604,10 +604,10 @@ Enables listening for the enabled status changes of the touch guide mode. This A
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Type of the event to listen for, which is set to **'touchGuideStateChange'** in this API.|
-| callback | Callback<boolean> | Yes| Callback used to return the result.|
+| Name | Type | Mandatory | Description |
+| -------- | ----------------------- | ---- | ---------------------------------------- |
+| type | string | Yes | Type of the event to listen for, which is set to **'touchGuideStateChange'** in this API.|
+| callback | Callback<boolean> | Yes | Callback used to return the result. |
**Example**
@@ -631,10 +631,10 @@ Disables listening for the enabled status changes of the accessibility applicati
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | No| Type of the event to listen for, which is set to **'accessibilityStateChange'** in this API.|
-| callback | Callback<boolean> | No| Callback used to return the result.|
+| Name | Type | Mandatory | Description |
+| -------- | ----------------------- | ---- | ---------------------------------------- |
+| type | string | No | Type of the event to listen for, which is set to **'accessibilityStateChange'** in this API.|
+| callback | Callback<boolean> | No | Callback for the event. |
**Example**
@@ -658,10 +658,10 @@ Disables listening for the enabled status changes of the touch guide mode. This
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | No| Type of the event to listen for, which is set to **'touchGuideStateChange'** in this API.|
-| callback | Callback<boolean> | No| Callback used to return the result.|
+| Name | Type | Mandatory | Description |
+| -------- | ----------------------- | ---- | ---------------------------------------- |
+| type | string | No | Type of the event to listen for, which is set to **'touchGuideStateChange'** in this API.|
+| callback | Callback<boolean> | No | Callback for the event. |
**Example**
@@ -685,8 +685,8 @@ Checks whether accessibility is enabled. This API uses a promise to return the r
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ---------------------- | ---------------------------------------- |
| Promise<boolean> | Promise used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise.|
**Example**
@@ -709,9 +709,9 @@ Checks whether accessibility is enabled. This API uses an asynchronous callback
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<boolean> | Yes| Callback used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise.|
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ----------------------------------- |
+| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Returns **true** if accessibility is enabled; returns **false** otherwise.|
**Example**
@@ -735,8 +735,8 @@ Checks whether touch guide mode is enabled. This API uses a promise to return th
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ---------------------- | ---------------------------------------- |
| Promise<boolean> | Promise used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
**Example**
@@ -759,9 +759,9 @@ Checks whether touch guide mode is enabled. This API uses an asynchronous callba
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<boolean> | Yes| Callback used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
+| Name | Type | Mandatory | Description |
+| -------- | ---------------------------- | ---- | ------------------------------------- |
+| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Returns **true** if touch guide mode is enabled; returns **false** otherwise.|
**Example**
@@ -790,14 +790,14 @@ Sends an accessibility event. This API uses a promise to return the result.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
+| Name | Type | Mandatory | Description |
+| ----- | ----------------------- | ---- | -------- |
+| event | [EventInfo](#eventinfo) | Yes | Accessibility event.|
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ------------------- | ---------------- |
| Promise<void> | Promise that returns no value.|
**Example**
@@ -830,10 +830,10 @@ Sends an accessibility event. This API uses an asynchronous callback to return t
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
-| callback | AsyncCallback<void> | Yes| Callback used to return the result. If the operation fails, **error** that contains data is returned. |
+| Name | Type | Mandatory | Description |
+| -------- | ------------------------- | ---- | ---------------------------------------- |
+| event | [EventInfo](#eventinfo) | Yes | Accessibility event. |
+| callback | AsyncCallback<void> | Yes | Callback used to return the result. If the operation fails, **error** that contains data is returned.|
**Example**
@@ -862,14 +862,14 @@ Sends an accessibility event. This API uses a promise to return the result.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
+| Name | Type | Mandatory | Description |
+| ----- | ----------------------- | ---- | -------- |
+| event | [EventInfo](#eventinfo) | Yes | Accessibility event.|
**Return value**
-| Type| Description|
-| -------- | -------- |
+| Type | Description |
+| ------------------- | ---------------- |
| Promise<void> | Promise that returns no value.|
**Example**
@@ -901,10 +901,10 @@ Sends an accessibility event. This API uses an asynchronous callback to return t
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| event | [EventInfo](#eventinfo) | Yes| Accessibility event.|
-| callback | AsyncCallback<void> | Yes| Callback used to return the result. If the operation fails, **error** that contains data is returned. |
+| Name | Type | Mandatory | Description |
+| -------- | ------------------------- | ---- | ---------------------------------------- |
+| event | [EventInfo](#eventinfo) | Yes | Accessibility event. |
+| callback | AsyncCallback<void> | Yes | Callback used to return the result. If the operation fails, **error** that contains data is returned.|
**Example**
diff --git a/en/application-dev/reference/apis/js-apis-app-ability-appManager.md b/en/application-dev/reference/apis/js-apis-app-ability-appManager.md
index 6be97f26f89b5bf8750a30555200d518990c709f..9fa26885cc9f8ab20b8c5a1dc17ee4be054195ad 100644
--- a/en/application-dev/reference/apis/js-apis-app-ability-appManager.md
+++ b/en/application-dev/reference/apis/js-apis-app-ability-appManager.md
@@ -22,9 +22,9 @@ Checks whether this application is undergoing a stability test. This API uses an
**Parameters**
-| Type| Description|
-| -------- | -------- |
-|AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
+ | Type| Description|
+ | -------- | -------- |
+ |AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
**Error codes**
@@ -59,9 +59,9 @@ Checks whether this application is undergoing a stability test. This API uses a
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is undergoing a stability test, and **false** means the opposite.|
**Error codes**
@@ -94,9 +94,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<boolean> | Promise used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
**Error codes**
@@ -128,9 +128,9 @@ Checks whether this application is running on a RAM constrained device. This API
**Parameters**
-| Type| Description|
-| -------- | -------- |
-| AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
+ | Type| Description|
+ | -------- | -------- |
+ | AsyncCallback<boolean> |Callback used to return the API call result and the result **true** or **false**. You can perform error handling or custom processing in this callback. The value **true** means that the application is running on a RAM constrained device, and **false** means the opposite.|
**Error codes**
@@ -164,9 +164,9 @@ Obtains the memory size of this application. This API uses a promise to return t
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<number> | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<number> | Promise used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
**Error codes**
@@ -198,9 +198,9 @@ Obtains the memory size of this application. This API uses an asynchronous callb
**Parameters**
-| Type| Description|
-| -------- | -------- |
-|AsyncCallback<number> |Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
+ | Type| Description|
+ | -------- | -------- |
+ |AsyncCallback<number> |Callback used to return the API call result and the memory size. You can perform error handling or custom processing in this callback.|
**Error codes**
@@ -298,6 +298,82 @@ appManager.getRunningProcessInformation((err, data) => {
});
```
+## appManager.isSharedBundleRunning
+
+isSharedBundleRunning(bundleName: string, versionCode: number): Promise\;
+
+Checks whether the shared library is in use. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.GET_RUNNING_INFO
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| --------- | ---------------------------------------- | ---- | -------------- |
+| bundleName | string | Yes | Bundle name of the shared library.|
+| versionCode | number | Yes | Version number of the shared library. |
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+| Promise\ | Promise used to return the result. The value **true** means that the shared library is in use, and **false** means the opposite.|
+
+**Example**
+
+```ts
+import appManager from '@ohos.app.ability.appManager';
+
+appManager.isSharedBundleRunning(bundleName, versionCode).then((data) => {
+ console.log('The shared bundle running is: ${JSON.stringify(data)}');
+}).catch((error) => {
+ console.error('error: ${JSON.stringify(error)}');
+});
+```
+
+## appManager.isSharedBundleRunning
+
+isSharedBundleRunning(bundleName: string, versionCode: number, callback: AsyncCallback\): void;
+
+Checks whether the shared library is in use. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.GET_RUNNING_INFO
+
+**System capability**: SystemCapability.Ability.AbilityRuntime.Core
+
+**System API**: This is a system API.
+
+**Parameters**
+
+| Name | Type | Mandatory | Description |
+| --------- | ---------------------------------------- | ---- | -------------- |
+| bundleName | string | Yes | Bundle name of the shared library.|
+| versionCode | number | Yes | Version number of the shared library. |
+
+**Return value**
+
+| Type| Description|
+| -------- | -------- |
+|AsyncCallback\> | Callback used to return the result. The value **true** means that the shared library is in use, and **false** means the opposite.|
+
+**Example**
+
+```ts
+import appManager from '@ohos.app.ability.appManager';
+
+appManager.isSharedBundleRunning(bundleName, versionCode, (err, data) => {
+ if (err) {
+ console.error('err: ${JSON.stringify(err)}');
+ } else {
+ console.log('The shared bundle running is: ${JSON.stringify(data)}');
+ }
+});
+```
+
## appManager.on
on(type: 'applicationState', observer: ApplicationStateObserver): number;
@@ -641,7 +717,7 @@ Obtains applications that are running in the foreground. This API uses a promise
| Type| Description|
| -------- | -------- |
-| Promise\> | Promise used to return an array holding the application state data. |
+| Promise\> | Promise used to return an array holding the application state data.|
**Error codes**
@@ -731,11 +807,11 @@ Kills a process by bundle name and account ID. This API uses an asynchronous cal
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| bundleName | string | Yes| Bundle name.|
-| accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
-| callback | AsyncCallback\ | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | bundleName | string | Yes| Bundle name.|
+ | accountId | number | Yes| ID of a system account. For details, see [getCreatedOsAccountsCount](js-apis-osAccount.md#getosaccountlocalidfromprocess).|
+ | callback | AsyncCallback\ | Yes| Callback used to return the API call result. You can perform error handling or custom processing in this callback.|
**Error codes**
diff --git a/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md b/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
index 0e8d9ef45d1ab0b7fbaf0573aff13112b5dfe02b..cfd08c64b6cd10f74516ad9bac10b8d0febd0b97 100644
--- a/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
+++ b/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md
@@ -315,7 +315,7 @@ class MyUIAbility extends UIAbility {
onShare(wantParam:{ [key: string]: Object }): void;
-Called when an ability shares data.
+Called when this UIAbility sets data to share. **ohos.extra.param.key.contentTitle** indicates the title of the content to share in the sharing box, and **ohos.extra.param.key.shareAbstract** provides an abstract description of the content, **ohos.extra.param.key.shareUrl** indicates the online address of the service. You need to set these three items as objects, with the key set to **title**, **abstract**, and **url**, respectively.
**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore
@@ -332,9 +332,9 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant';
class MyUIAbility extends UIAbility {
onShare(wantParams) {
console.log('onShare');
- wantParams['ohos.extra.param.key.contentTitle'] = {title: "W3"};
- wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for huawei employee"};
- wantParams['ohos.extra.param.key.shareUrl'] = {url: "w3.huawei.com"};
+ wantParams['ohos.extra.param.key.contentTitle'] = {title: "OA"};
+ wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for company employee"};
+ wantParams['ohos.extra.param.key.shareUrl'] = {url: "oa.example.com"};
}
}
```
diff --git a/en/application-dev/reference/apis/js-apis-appAccount.md b/en/application-dev/reference/apis/js-apis-appAccount.md
index 307b991bc1f5725cd7dffd73bc93ced1541ab004..6bb26ca37ab1d320d904cdaa17c5a100291f322c 100644
--- a/en/application-dev/reference/apis/js-apis-appAccount.md
+++ b/en/application-dev/reference/apis/js-apis-appAccount.md
@@ -65,11 +65,11 @@ Creates an app account. This API uses an asynchronous callback to return the res
```js
try {
- appAccountManager.createAccount("WangWu", (err) => {
- console.log("createAccount err: " + JSON.stringify(err));
+ appAccountManager.createAccount('WangWu', (err) => {
+ console.log('createAccount err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("createAccount err: " + JSON.stringify(err));
+ console.log('createAccount err: ' + JSON.stringify(err));
}
```
@@ -103,19 +103,19 @@ Creates an app account with custom data. This API uses an asynchronous callback
```js
let options = {
customData: {
- "age": "10"
+ 'age': '10'
}
}
try {
- appAccountManager.createAccount("LiSi", options, (err) => {
+ appAccountManager.createAccount('LiSi', options, (err) => {
if (err) {
- console.log("createAccount failed, error: " + JSON.stringify(err));
+ console.log('createAccount failed, error: ' + JSON.stringify(err));
} else {
- console.log("createAccount successfully");
+ console.log('createAccount successfully');
}
});
} catch(err) {
- console.log("createAccount exception: " + JSON.stringify(err));
+ console.log('createAccount exception: ' + JSON.stringify(err));
}
```
@@ -132,7 +132,7 @@ Creates an app account with custom data. This API uses a promise to return the r
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------------------------------- |
| name | string | Yes | Name of the app account to create. |
-| options | [CreateAccountOptions](#createaccountoptions9) | No | Options for creating the app account. You can customize data based on service requirements, but do not add sensitive data (such as passwords and tokens). This parameter can be left empty.|
+| options | [CreateAccountOptions](#createaccountoptions9) | No | Options for creating the app account. You can customize data based on service requirements, but do not add sensitive data (such as passwords and tokens). By default, no value is passed, which means no additional information needs to be added for the account.|
**Return value**
@@ -154,17 +154,17 @@ Creates an app account with custom data. This API uses a promise to return the r
```js
let options = {
customData: {
- "age": "10"
+ 'age': '10'
}
}
try {
- appAccountManager.createAccount("LiSi", options).then(() => {
- console.log("createAccount successfully");
+ appAccountManager.createAccount('LiSi', options).then(() => {
+ console.log('createAccount successfully');
}).catch((err) => {
- console.log("createAccount failed, error: " + JSON.stringify(err));
+ console.log('createAccount failed, error: ' + JSON.stringify(err));
});
} catch(err) {
- console.log("createAccount exception: " + JSON.stringify(err));
+ console.log('createAccount exception: ' + JSON.stringify(err));
}
```
@@ -198,8 +198,8 @@ Creates an app account implicitly based on the specified account owner. This API
```js
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -210,19 +210,19 @@ Creates an app account implicitly based on the specified account owner. This API
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
try {
- appAccountManager.createAccountImplicitly("com.example.accountjsdemo", {
+ appAccountManager.createAccountImplicitly('com.example.accountjsdemo', {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("createAccountImplicitly exception: " + JSON.stringify(err));
+ console.log('createAccountImplicitly exception: ' + JSON.stringify(err));
}
```
@@ -257,8 +257,8 @@ Creates an app account implicitly based on the specified account owner and optio
```js
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -269,23 +269,23 @@ Creates an app account implicitly based on the specified account owner and optio
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
let options = {
- authType: "getSocialData",
- requiredLabels: [ "student" ]
+ authType: 'getSocialData',
+ requiredLabels: [ 'student' ]
};
try {
- appAccountManager.createAccountImplicitly("com.example.accountjsdemo", options, {
+ appAccountManager.createAccountImplicitly('com.example.accountjsdemo', options, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("createAccountImplicitly exception: " + JSON.stringify(err));
+ console.log('createAccountImplicitly exception: ' + JSON.stringify(err));
}
```
@@ -316,15 +316,15 @@ Removes an app account. This API uses an asynchronous callback to return the res
```js
try {
- appAccountManager.removeAccount("ZhaoLiu", (err) => {
+ appAccountManager.removeAccount('ZhaoLiu', (err) => {
if (err) {
- console.log("removeAccount failed, error: " + JSON.stringify(err));
+ console.log('removeAccount failed, error: ' + JSON.stringify(err));
} else {
- console.log("removeAccount successfully");
+ console.log('removeAccount successfully');
}
});
} catch(err) {
- console.log("removeAccount exception: " + JSON.stringify(err));
+ console.log('removeAccount exception: ' + JSON.stringify(err));
}
```
@@ -360,13 +360,13 @@ Removes an app account. This API uses a promise to return the result.
```js
try {
- appAccountManager.removeAccount("Lisi").then(() => {
- console.log("removeAccount successfully");
+ appAccountManager.removeAccount('Lisi').then(() => {
+ console.log('removeAccount successfully');
}).catch((err) => {
- console.log("removeAccount failed, error: " + JSON.stringify(err));
+ console.log('removeAccount failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("removeAccount exception: " + JSON.stringify(err));
+ console.log('removeAccount exception: ' + JSON.stringify(err));
}
```
@@ -400,15 +400,15 @@ Sets the access to the data of an account for an app. This API uses an asynchron
```js
try {
- appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true, (err) => {
+ appAccountManager.setAppAccess('ZhangSan', 'com.example.accountjsdemo', true, (err) => {
if (err) {
- console.log("setAppAccess failed: " + JSON.stringify(err));
+ console.log('setAppAccess failed: ' + JSON.stringify(err));
} else {
- console.log("setAppAccess successfully");
+ console.log('setAppAccess successfully');
}
});
} catch (err) {
- console.log("setAppAccess exception: " + JSON.stringify(err));
+ console.log('setAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -447,13 +447,13 @@ Sets the access to the data of an account for an app. This API uses a promise to
```js
try {
- appAccountManager.setAppAccess("ZhangSan", "com.example.accountjsdemo", true).then(() => {
- console.log("setAppAccess successfully");
+ appAccountManager.setAppAccess('ZhangSan', 'com.example.accountjsdemo', true).then(() => {
+ console.log('setAppAccess successfully');
}).catch((err) => {
- console.log("setAppAccess failed: " + JSON.stringify(err));
+ console.log('setAppAccess failed: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setAppAccess exception: " + JSON.stringify(err));
+ console.log('setAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -485,15 +485,15 @@ Checks whether an app can access the data of an account. This API uses an asynch
```js
try {
- appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo", (err, isAccessible) => {
+ appAccountManager.checkAppAccess('ZhangSan', 'com.example.accountjsdemo', (err, isAccessible) => {
if (err) {
- console.log("checkAppAccess failed, error: " + JSON.stringify(err));
+ console.log('checkAppAccess failed, error: ' + JSON.stringify(err));
} else {
- console.log("checkAppAccess successfully");
+ console.log('checkAppAccess successfully');
}
});
} catch (err) {
- console.log("checkAppAccess exception: " + JSON.stringify(err));
+ console.log('checkAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -530,13 +530,13 @@ Checks whether an app can access the data of an account. This API uses a promise
```js
try {
- appAccountManager.checkAppAccess("ZhangSan", "com.example.accountjsdemo").then((isAccessible) => {
- console.log("checkAppAccess successfully, isAccessible: " + isAccessible);
+ appAccountManager.checkAppAccess('ZhangSan', 'com.example.accountjsdemo').then((isAccessible) => {
+ console.log('checkAppAccess successfully, isAccessible: ' + isAccessible);
}).catch((err) => {
- console.log("checkAppAccess failed, error: " + JSON.stringify(err));
+ console.log('checkAppAccess failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkAppAccess exception: " + JSON.stringify(err));
+ console.log('checkAppAccess exception: ' + JSON.stringify(err));
}
```
@@ -570,11 +570,11 @@ Sets data synchronization for an app account. This API uses an asynchronous call
```js
try {
- appAccountManager.setDataSyncEnabled("ZhangSan", true, (err) => {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ appAccountManager.setDataSyncEnabled('ZhangSan', true, (err) => {
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -613,13 +613,13 @@ Sets data synchronization for an app account. This API uses a promise to return
```js
try {
- appAccountManager .setDataSyncEnabled("ZhangSan", true).then(() => {
+ appAccountManager .setDataSyncEnabled('ZhangSan', true).then(() => {
console.log('setDataSyncEnabled Success');
}).catch((err) => {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('setDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -652,15 +652,15 @@ Checks whether data synchronization is enabled for an app account. This API uses
```js
try {
- appAccountManager.checkDataSyncEnabled("ZhangSan", (err, isEnabled) => {
+ appAccountManager.checkDataSyncEnabled('ZhangSan', (err, isEnabled) => {
if (err) {
- console.log("checkDataSyncEnabled failed, err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled failed, err: ' + JSON.stringify(err));
} else {
console.log('checkDataSyncEnabled successfully, isEnabled: ' + isEnabled);
}
});
} catch (err) {
- console.log("checkDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -698,13 +698,13 @@ Checks whether data synchronization is enabled for an app account. This API uses
```js
try {
- appAccountManager.checkDataSyncEnabled("ZhangSan").then((isEnabled) => {
- console.log("checkDataSyncEnabled successfully, isEnabled: " + isEnabled);
+ appAccountManager.checkDataSyncEnabled('ZhangSan').then((isEnabled) => {
+ console.log('checkDataSyncEnabled successfully, isEnabled: ' + isEnabled);
}).catch((err) => {
- console.log("checkDataSyncEnabled failed, err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled failed, err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkDataSyncEnabled err: " + JSON.stringify(err));
+ console.log('checkDataSyncEnabled err: ' + JSON.stringify(err));
}
```
@@ -737,15 +737,15 @@ Sets a credential for an app account. This API uses an asynchronous callback to
```js
try {
- appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx", (err) => {
+ appAccountManager.setCredential('ZhangSan', 'PIN_SIX', 'xxxxxx', (err) => {
if (err) {
- console.log("setCredential failed, error: " + JSON.stringify(err));
+ console.log('setCredential failed, error: ' + JSON.stringify(err));
} else {
- console.log("setCredential successfully");
+ console.log('setCredential successfully');
}
});
} catch (err) {
- console.log("setCredential exception: " + JSON.stringify(err));
+ console.log('setCredential exception: ' + JSON.stringify(err));
}
```
@@ -783,13 +783,13 @@ Sets a credential for an app account. This API uses a promise to return the resu
```js
try {
- appAccountManager.setCredential("ZhangSan", "PIN_SIX", "xxxxxx").then(() => {
- console.log("setCredential successfully");
+ appAccountManager.setCredential('ZhangSan', 'PIN_SIX', 'xxxxxx').then(() => {
+ console.log('setCredential successfully');
}).catch((err) => {
- console.log("setCredential failed, error: " + JSON.stringify(err));
+ console.log('setCredential failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setCredential exception: " + JSON.stringify(err));
+ console.log('setCredential exception: ' + JSON.stringify(err));
}
```
@@ -822,15 +822,15 @@ Obtains the credential of an app account. This API uses an asynchronous callback
```js
try {
- appAccountManager.getCredential("ZhangSan", "PIN_SIX", (err, result) => {
+ appAccountManager.getCredential('ZhangSan', 'PIN_SIX', (err, result) => {
if (err) {
- console.log("getCredential failed, error: " + JSON.stringify(err));
+ console.log('getCredential failed, error: ' + JSON.stringify(err));
} else {
console.log('getCredential successfully, result: ' + result);
}
});
} catch (err) {
- console.log("getCredential err: " + JSON.stringify(err));
+ console.log('getCredential err: ' + JSON.stringify(err));
}
```
@@ -868,13 +868,13 @@ Obtains the credential of an app account. This API uses a promise to return the
```js
try {
- appAccountManager.getCredential("ZhangSan", "PIN_SIX").then((credential) => {
- console.log("getCredential successfully, credential: " + credential);
+ appAccountManager.getCredential('ZhangSan', 'PIN_SIX').then((credential) => {
+ console.log('getCredential successfully, credential: ' + credential);
}).catch((err) => {
- console.log("getCredential failed, error: " + JSON.stringify(err));
+ console.log('getCredential failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getCredential exception: " + JSON.stringify(err));
+ console.log('getCredential exception: ' + JSON.stringify(err));
}
```
@@ -908,15 +908,15 @@ Sets custom data for an app account. This API uses an asynchronous callback to r
```js
try {
- appAccountManager.setCustomData("ZhangSan", "age", "12", (err) => {
+ appAccountManager.setCustomData('ZhangSan', 'age', '12', (err) => {
if (err) {
- console.log("setCustomData failed, error: " + JSON.stringify(err));
+ console.log('setCustomData failed, error: ' + JSON.stringify(err));
} else {
- console.log("setCustomData successfully");
+ console.log('setCustomData successfully');
}
});
} catch (err) {
- console.log("setCustomData exception: " + JSON.stringify(err));
+ console.log('setCustomData exception: ' + JSON.stringify(err));
}
```
@@ -955,13 +955,13 @@ Sets custom data for an app account. This API uses a promise to return the resul
```js
try {
- appAccountManager.setCustomData("ZhangSan", "age", "12").then(() => {
- console.log("setCustomData successfully");
+ appAccountManager.setCustomData('ZhangSan', 'age', '12').then(() => {
+ console.log('setCustomData successfully');
}).catch((err) => {
- console.log("setCustomData failed, error: " + JSON.stringify(err));
+ console.log('setCustomData failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setCustomData exception: " + JSON.stringify(err));
+ console.log('setCustomData exception: ' + JSON.stringify(err));
}
```
@@ -994,15 +994,15 @@ Obtains the custom data of an app account based on the specified key. This API u
```js
try {
- appAccountManager.getCustomData("ZhangSan", "age", (err, data) => {
+ appAccountManager.getCustomData('ZhangSan', 'age', (err, data) => {
if (err) {
console.log('getCustomData failed, error: ' + err);
} else {
- console.log("getCustomData successfully, data: " + data);
+ console.log('getCustomData successfully, data: ' + data);
}
});
} catch (err) {
- console.log("getCustomData exception: " + JSON.stringify(err));
+ console.log('getCustomData exception: ' + JSON.stringify(err));
}
```
@@ -1040,13 +1040,13 @@ Obtains the custom data of an app account based on the specified key. This API u
```js
try {
- appAccountManager.getCustomData("ZhangSan", "age").then((data) => {
- console.log("getCustomData successfully, data: " + data);
+ appAccountManager.getCustomData('ZhangSan', 'age').then((data) => {
+ console.log('getCustomData successfully, data: ' + data);
}).catch((err) => {
- console.log("getCustomData failed, error: " + JSON.stringify(err));
+ console.log('getCustomData failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getCustomData exception: " + JSON.stringify(err));
+ console.log('getCustomData exception: ' + JSON.stringify(err));
}
```
@@ -1084,10 +1084,10 @@ Obtains the custom data of an app account based on the specified key. The API re
```js
try {
- let value = appAccountManager.getCustomDataSync("ZhangSan", "age");
- console.info("getCustomDataSync successfully, vaue:" + value);
+ let value = appAccountManager.getCustomDataSync('ZhangSan', 'age');
+ console.info('getCustomDataSync successfully, vaue: ' + value);
} catch (err) {
- console.error("getCustomDataSync failed, error: " + JSON.stringify(err));
+ console.error('getCustomDataSync failed, error: ' + JSON.stringify(err));
}
```
@@ -1117,13 +1117,13 @@ Obtains information about all accessible app accounts. This API uses an asynchro
try {
appAccountManager.getAllAccounts((err, data) => {
if (err) {
- console.debug("getAllAccounts failed, error:" + JSON.stringify(err));
+ console.debug('getAllAccounts failed, error: ' + JSON.stringify(err));
} else {
- console.debug("getAllAccounts successfully");
+ console.debug('getAllAccounts successfully');
}
});
} catch (err) {
- console.debug("getAllAccounts exception: " + JSON.stringify(err));
+ console.debug('getAllAccounts exception: ' + JSON.stringify(err));
}
```
@@ -1152,12 +1152,12 @@ Obtains information about all accessible app accounts. This API uses a promise t
```js
try {
appAccountManager.getAllAccounts().then((data) => {
- console.debug("getAllAccounts successfully");
+ console.debug('getAllAccounts successfully');
}).catch((err) => {
- console.debug("getAllAccounts failed, error:" + JSON.stringify(err));
+ console.debug('getAllAccounts failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.debug("getAllAccounts exception: " + JSON.stringify(err));
+ console.debug('getAllAccounts exception: ' + JSON.stringify(err));
}
```
@@ -1188,15 +1188,15 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
```js
try {
- appAccountManager.getAccountsByOwner("com.example.accountjsdemo2", (err, data) => {
+ appAccountManager.getAccountsByOwner('com.example.accountjsdemo2', (err, data) => {
if (err) {
- console.debug("getAccountsByOwner failed, error:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner failed, error:' + JSON.stringify(err));
} else {
- console.debug("getAccountsByOwner successfully, data:" + JSON.stringify(data));
+ console.debug('getAccountsByOwner successfully, data:' + JSON.stringify(data));
}
});
} catch (err) {
- console.debug("getAccountsByOwner exception:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner exception:' + JSON.stringify(err));
}
```
@@ -1232,13 +1232,13 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
```js
try {
- appAccountManager.getAccountsByOwner("com.example.accountjsdemo2").then((data) => {
- console.debug("getAccountsByOwner successfully, data:" + JSON.stringify(data));
+ appAccountManager.getAccountsByOwner('com.example.accountjsdemo2').then((data) => {
+ console.debug('getAccountsByOwner successfully, data: ' + JSON.stringify(data));
}).catch((err) => {
- console.debug("getAccountsByOwner failed, error:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.debug("getAccountsByOwner exception:" + JSON.stringify(err));
+ console.debug('getAccountsByOwner exception: ' + JSON.stringify(err));
}
```
@@ -1256,7 +1256,7 @@ Subscribes to account information changes of apps.
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | 'accountChange' | Yes | Event type to subscribe to. The value is **'accountChange'**. An event will be reported when the account information of the target app changes.|
| owners | Array<string> | Yes | App bundle names of the account. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return a list of app accounts whose information is changed. |
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback registered to return the list of changed app accounts. |
**Error codes**
@@ -1270,12 +1270,12 @@ Subscribes to account information changes of apps.
```js
function changeOnCallback(data){
- console.log("receive change data:" + JSON.stringify(data));
+ console.log('receive change data:' + JSON.stringify(data));
}
try{
- appAccountManager.on("accountChange", ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('accountChange', ['com.example.actsaccounttest'], changeOnCallback);
} catch(err) {
- console.error("on accountChange failed, error:" + JSON.stringify(err));
+ console.error('on accountChange failed, error:' + JSON.stringify(err));
}
```
@@ -1292,7 +1292,7 @@ Unsubscribes from account information changes.
| Name | Type | Mandatory | Description |
| -------- | -------------------------------- | ---- | ------------ |
| type | 'accountChange' | Yes | Event type to unsubscribe from. The value is **'accountChange'**. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister.|
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister. By default, no value is passed, which means to unregister all callbacks for the specified event.|
**Error codes**
@@ -1305,18 +1305,18 @@ Unsubscribes from account information changes.
```js
function changeOnCallback(data) {
- console.log("receive change data:" + JSON.stringify(data));
+ console.log('receive change data:' + JSON.stringify(data));
}
try{
- appAccountManager.on("accountChange", ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('accountChange', ['com.example.actsaccounttest'], changeOnCallback);
} catch(err) {
- console.error("on accountChange failed, error:" + JSON.stringify(err));
+ console.error('on accountChange failed, error:' + JSON.stringify(err));
}
try{
appAccountManager.off('accountChange', changeOnCallback);
}
catch(err){
- console.error("off accountChange failed, error:" + JSON.stringify(err));
+ console.error('off accountChange failed, error:' + JSON.stringify(err));
}
```
@@ -1354,8 +1354,8 @@ Authenticates an app account. This API uses an asynchronous callback to return t
function onResultCallback(code, authResult) {
- console.log("resultCode: " + code);
- console.log("authResult: " + JSON.stringify(authResult));
+ console.log('resultCode: ' + code);
+ console.log('authResult: ' + JSON.stringify(authResult));
}
function onRequestRedirectedCallback(request) {
@@ -1366,19 +1366,19 @@ Authenticates an app account. This API uses an asynchronous callback to return t
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
try {
- appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", {
+ appAccountManager.auth('LiSi', 'com.example.accountjsdemo', 'getSocialData', {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("auth exception: " + JSON.stringify(err));
+ console.log('auth exception: ' + JSON.stringify(err));
}
```
@@ -1417,8 +1417,8 @@ Authenticates an app account with customized options. This API uses an asynchron
function onResultCallback(code, authResult) {
- console.log("resultCode: " + code);
- console.log("authResult: " + JSON.stringify(authResult));
+ console.log('resultCode: ' + code);
+ console.log('authResult: ' + JSON.stringify(authResult));
}
function onRequestRedirectedCallback(request) {
@@ -1429,22 +1429,22 @@ Authenticates an app account with customized options. This API uses an asynchron
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
let options = {
- "password": "xxxx",
+ 'password': 'xxxx',
};
try {
- appAccountManager.auth("LiSi", "com.example.accountjsdemo", "getSocialData", options, {
+ appAccountManager.auth('LiSi', 'com.example.accountjsdemo', 'getSocialData', options, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
} catch (err) {
- console.log("auth exception: " + JSON.stringify(err));
+ console.log('auth exception: ' + JSON.stringify(err));
}
```
@@ -1478,15 +1478,15 @@ Obtains the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, token) => {
+ appAccountManager.getAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', (err, token) => {
if (err) {
- console.log("getAuthToken failed, error: " + JSON.stringify(err));
+ console.log('getAuthToken failed, error: ' + JSON.stringify(err));
} else {
- console.log("getAuthToken successfully, token: " + token);
+ console.log('getAuthToken successfully, token: ' + token);
}
});
} catch (err) {
- console.log("getAuthToken exception: " + JSON.stringify(err));
+ console.log('getAuthToken exception: ' + JSON.stringify(err));
}
```
@@ -1525,13 +1525,13 @@ Obtains the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.getAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((token) => {
- console.log("getAuthToken successfully, token: " + token);
+ appAccountManager.getAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData').then((token) => {
+ console.log('getAuthToken successfully, token: ' + token);
}).catch((err) => {
- console.log("getAuthToken failed, error: " + JSON.stringify(err));
+ console.log('getAuthToken failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAuthToken exception: " + JSON.stringify(err));
+ console.log('getAuthToken exception: ' + JSON.stringify(err));
}
```
@@ -1565,11 +1565,11 @@ Sets an authorization token of the specific authentication type for an app accou
```js
try {
- appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx", (err) => {
+ appAccountManager.setAuthToken('LiSi', 'getSocialData', 'xxxx', (err) => {
if (err) {
- console.log("setAuthToken failed, error: " + JSON.stringify(err));
+ console.log('setAuthToken failed, error: ' + JSON.stringify(err));
} else {
- console.log("setAuthToken successfully");
+ console.log('setAuthToken successfully');
}
});
} catch (err) {
@@ -1612,13 +1612,13 @@ Sets an authorization token of the specific authentication type for an app accou
```js
try {
- appAccountManager.setAuthToken("LiSi", "getSocialData", "xxxx").then(() => {
- console.log("setAuthToken successfully");
+ appAccountManager.setAuthToken('LiSi', 'getSocialData', 'xxxx').then(() => {
+ console.log('setAuthToken successfully');
}).catch((err) => {
- console.log("setAuthToken failed, error: " + JSON.stringify(err));
+ console.log('setAuthToken failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setAuthToken exception: " + JSON.stringify(err));
+ console.log('setAuthToken exception: ' + JSON.stringify(err));
}
```
@@ -1653,11 +1653,11 @@ Deletes the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => {
+ appAccountManager.deleteAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx', (err) => {
if (err) {
console.log('deleteAuthToken failed, error: ' + JSON.stringify(err));
} else {
- console.log("deleteAuthToken successfully");
+ console.log('deleteAuthToken successfully');
}
});
} catch (err) {
@@ -1701,8 +1701,8 @@ Deletes the authorization token of the specified authentication type for an app
```js
try {
- appAccountManager.deleteAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => {
- console.log("deleteAuthToken successfully");
+ appAccountManager.deleteAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx').then(() => {
+ console.log('deleteAuthToken successfully');
}).catch((err) => {
console.log('deleteAuthToken failed, error: ' + JSON.stringify(err));
});
@@ -1744,15 +1744,15 @@ Sets the visibility of an authorization token to an app. This API uses an asynch
```js
try {
- appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => {
+ appAccountManager.setAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true, (err) => {
if (err) {
- console.log("setAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility failed, error: ' + JSON.stringify(err));
} else {
- console.log("setAuthTokenVisibility successfully");
+ console.log('setAuthTokenVisibility successfully');
}
});
} catch (err) {
- console.log("setAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1794,13 +1794,13 @@ Sets the visibility of an authorization token to an app. This API uses a promise
```js
try {
- appAccountManager.setAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => {
- console.log("setAuthTokenVisibility successfully");
+ appAccountManager.setAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true).then(() => {
+ console.log('setAuthTokenVisibility successfully');
}).catch((err) => {
- console.log("setAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("setAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('setAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1834,15 +1834,15 @@ Checks the visibility of an authorization token of the specified authentication
```js
try {
- appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, isVisible) => {
+ appAccountManager.checkAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', (err, isVisible) => {
if (err) {
- console.log("checkAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility failed, error: ' + JSON.stringify(err));
} else {
- console.log("checkAuthTokenVisibility successfully, isVisible: " + isVisible);
+ console.log('checkAuthTokenVisibility successfully, isVisible: ' + isVisible);
}
});
} catch (err) {
- console.log("checkAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1881,13 +1881,13 @@ Checks the visibility of an authorization token of the specified authentication
```js
try {
- appAccountManager.checkAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((isVisible) => {
- console.log("checkAuthTokenVisibility successfully, isVisible: " + isVisible);
+ appAccountManager.checkAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo').then((isVisible) => {
+ console.log('checkAuthTokenVisibility successfully, isVisible: ' + isVisible);
}).catch((err) => {
- console.log("checkAuthTokenVisibility failed, error: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkAuthTokenVisibility exception: " + JSON.stringify(err));
+ console.log('checkAuthTokenVisibility exception: ' + JSON.stringify(err));
}
```
@@ -1919,15 +1919,15 @@ Obtains all tokens visible to the invoker for an app account. This API uses an a
```js
try {
- appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo", (err, tokenArr) => {
+ appAccountManager.getAllAuthTokens('LiSi', 'com.example.accountjsdemo', (err, tokenArr) => {
if (err) {
- console.log("getAllAuthTokens failed, error: " + JSON.stringify(err));
+ console.log('getAllAuthTokens failed, error: ' + JSON.stringify(err));
} else {
console.log('getAllAuthTokens successfully, tokenArr: ' + tokenArr);
}
});
} catch (err) {
- console.log("getAllAuthTokens exception: " + JSON.stringify(err));
+ console.log('getAllAuthTokens exception: ' + JSON.stringify(err));
}
```
@@ -1964,13 +1964,13 @@ Obtains all tokens visible to the invoker for an app account. This API uses a pr
```js
try {
- appAccountManager.getAllAuthTokens("LiSi", "com.example.accountjsdemo").then((tokenArr) => {
+ appAccountManager.getAllAuthTokens('LiSi', 'com.example.accountjsdemo').then((tokenArr) => {
console.log('getAllAuthTokens successfully, tokenArr: ' + JSON.stringify(tokenArr));
}).catch((err) => {
- console.log("getAllAuthTokens failed, error: " + JSON.stringify(err));
+ console.log('getAllAuthTokens failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAllAuthTokens exception: " + JSON.stringify(err));
+ console.log('getAllAuthTokens exception: ' + JSON.stringify(err));
}
```
@@ -2003,11 +2003,11 @@ Obtains the authorization list of the specified authentication type for an app a
```js
try {
- appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData", (err, authList) => {
+ appAccountManager.getAuthList('LiSi', 'getSocialData', (err, authList) => {
if (err) {
- console.log("getAuthList failed, error: " + JSON.stringify(err));
+ console.log('getAuthList failed, error: ' + JSON.stringify(err));
} else {
- console.log("getAuthList successfully, authList: " + authList);
+ console.log('getAuthList successfully, authList: ' + authList);
}
});
} catch (err) {
@@ -2049,13 +2049,13 @@ Obtains the authorization list of the specified authentication type for an app a
```js
try {
- appAccountManager.getAuthList("com.example.accountjsdemo", "getSocialData").then((authList) => {
- console.log("getAuthList successfully, authList: " + authList);
+ appAccountManager.getAuthList('LiSi', 'getSocialData').then((authList) => {
+ console.log('getAuthList successfully, authList: ' + authList);
}).catch((err) => {
- console.log("getAuthList failed, error: " + JSON.stringify(err));
+ console.log('getAuthList failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAuthList exception: " + JSON.stringify(err));
+ console.log('getAuthList exception: ' + JSON.stringify(err));
}
```
@@ -2063,7 +2063,7 @@ Obtains the authorization list of the specified authentication type for an app a
getAuthCallback(sessionId: string, callback: AsyncCallback<AuthCallback>): void
-Obtains the authenticator callback for the authentication session. This API uses an asynchronous callback to return the result.
+Obtains the authenticator callback for an authentication session. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Account.AppAccount
@@ -2093,23 +2093,23 @@ Obtains the authenticator callback for the authentication session. This API uses
try {
appAccountManager.getAuthCallback(sessionId, (err, callback) => {
if (err != null) {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
return;
}
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(0, result);
});
} catch (err) {
- console.log("getAuthCallback exception: " + JSON.stringify(err));
+ console.log('getAuthCallback exception: ' + JSON.stringify(err));
}
}
}
@@ -2119,7 +2119,7 @@ Obtains the authenticator callback for the authentication session. This API uses
getAuthCallback(sessionId: string): Promise<AuthCallback>
-Obtains the authenticator callback for the authentication session. This API uses a promise to return the result.
+Obtains the authenticator callback for an authentication session. This API uses a promise to return the result.
**System capability**: SystemCapability.Account.AppAccount
@@ -2155,20 +2155,20 @@ Obtains the authenticator callback for the authentication session. This API uses
appAccountManager.getAuthCallback(sessionId).then((callback) => {
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(0, result);
}).catch((err) => {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("getAuthCallback exception: " + JSON.stringify(err));
+ console.log('getAuthCallback exception: ' + JSON.stringify(err));
}
}
}
@@ -2201,15 +2201,15 @@ Obtains the authenticator information of an app. This API uses an asynchronous c
```js
try {
- appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo", (err, info) => {
+ appAccountManager.queryAuthenticatorInfo('com.example.accountjsdemo', (err, info) => {
if (err) {
- console.log("queryAuthenticatorInfo failed, error: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo failed, error: ' + JSON.stringify(err));
} else {
console.log('queryAuthenticatorInfo successfully, info: ' + JSON.stringify(info));
}
});
} catch (err) {
- console.log("queryAuthenticatorInfo exception: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo exception: ' + JSON.stringify(err));
}
```
@@ -2245,13 +2245,13 @@ Obtains the authenticator information of an app. This API uses a promise to retu
```js
try {
- appAccountManager.queryAuthenticatorInfo("com.example.accountjsdemo").then((info) => {
- console.log("queryAuthenticatorInfo successfully, info: " + JSON.stringify(info));
+ appAccountManager.queryAuthenticatorInfo('com.example.accountjsdemo').then((info) => {
+ console.log('queryAuthenticatorInfo successfully, info: ' + JSON.stringify(info));
}).catch((err) => {
- console.log("queryAuthenticatorInfo failed, error: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("queryAuthenticatorInfo exception: " + JSON.stringify(err));
+ console.log('queryAuthenticatorInfo exception: ' + JSON.stringify(err));
}
```
@@ -2286,17 +2286,17 @@ Checks whether an app account has specific labels. This API uses an asynchronous
**Example**
```js
- let labels = ["student"];
+ let labels = ['student'];
try {
- appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels, (err, hasAllLabels) => {
+ appAccountManager.checkAccountLabels('zhangsan', 'com.example.accountjsdemo', labels, (err, hasAllLabels) => {
if (err) {
- console.log("checkAccountLabels failed, error: " + JSON.stringify(err));
+ console.log('checkAccountLabels failed, error: ' + JSON.stringify(err));
} else {
- console.log("checkAccountLabels successfully, hasAllLabels: " + hasAllLabels);
+ console.log('checkAccountLabels successfully, hasAllLabels: ' + hasAllLabels);
}
});
} catch (err) {
- console.log("checkAccountLabels exception: " + JSON.stringify(err));
+ console.log('checkAccountLabels exception: ' + JSON.stringify(err));
}
```
@@ -2336,15 +2336,15 @@ Checks whether an app account has specific labels. This API uses a promise to re
**Example**
```js
- let labels = ["student"];
+ let labels = ['student'];
try {
- appAccountManager.checkAccountLabels("zhangsan", "com.example.accountjsdemo", labels).then((hasAllLabels) => {
+ appAccountManager.checkAccountLabels('zhangsan', 'com.example.accountjsdemo', labels).then((hasAllLabels) => {
console.log('checkAccountLabels successfully: ' + hasAllLabels);
}).catch((err) => {
- console.log("checkAccountLabels failed, error: " + JSON.stringify(err));
+ console.log('checkAccountLabels failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("checkAccountLabels exception: " + JSON.stringify(err));
+ console.log('checkAccountLabels exception: ' + JSON.stringify(err));
}
```
@@ -2377,15 +2377,15 @@ Deletes the credential of the specified type from an app account. This API uses
```js
try {
- appAccountManager.deleteCredential("zhangsan", "PIN_SIX", (err) => {
+ appAccountManager.deleteCredential('zhangsan', 'PIN_SIX', (err) => {
if (err) {
- console.log("deleteCredential failed, error: " + JSON.stringify(err));
+ console.log('deleteCredential failed, error: ' + JSON.stringify(err));
} else {
- console.log("deleteCredential successfully");
+ console.log('deleteCredential successfully');
}
});
} catch (err) {
- console.log("deleteCredential exception: " + JSON.stringify(err));
+ console.log('deleteCredential exception: ' + JSON.stringify(err));
}
```
@@ -2423,13 +2423,13 @@ Deletes the credential of the specified type from an app account. This API uses
```js
try {
- appAccountManager.deleteCredential("zhangsan", "PIN_SIX").then(() => {
- console.log("deleteCredential successfully");
+ appAccountManager.deleteCredential('zhangsan', 'PIN_SIX').then(() => {
+ console.log('deleteCredential successfully');
}).catch((err) => {
- console.log("deleteCredential failed, error: " + JSON.stringify(err));
+ console.log('deleteCredential failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("deleteCredential exception: " + JSON.stringify(err));
+ console.log('deleteCredential exception: ' + JSON.stringify(err));
}
```
@@ -2461,19 +2461,19 @@ Selects the accounts that can be accessed by the invoker based on the options. T
```js
let options = {
- allowedOwners: [ "com.example.accountjsdemo" ],
- requiredLabels: [ "student" ]
+ allowedOwners: [ 'com.example.accountjsdemo' ],
+ requiredLabels: [ 'student' ]
};
try {
appAccountManager.selectAccountsByOptions(options, (err, accountArr) => {
if (err) {
- console.log("selectAccountsByOptions failed, error: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions failed, error: ' + JSON.stringify(err));
} else {
- console.log("selectAccountsByOptions successfully, accountArr: " + JSON.stringify(accountArr));
+ console.log('selectAccountsByOptions successfully, accountArr: ' + JSON.stringify(accountArr));
}
});
} catch (err) {
- console.log("selectAccountsByOptions exception: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions exception: ' + JSON.stringify(err));
}
```
@@ -2510,16 +2510,16 @@ Selects the accounts that can be accessed by the invoker based on the options. T
```js
let options = {
- allowedOwners: ["com.example.accountjsdemo"]
+ allowedOwners: ['com.example.accountjsdemo']
};
try {
appAccountManager.selectAccountsByOptions(options).then((accountArr) => {
- console.log("selectAccountsByOptions successfully, accountArr: " + JSON.stringify(accountArr));
+ console.log('selectAccountsByOptions successfully, accountArr: ' + JSON.stringify(accountArr));
}).catch((err) => {
- console.log("selectAccountsByOptions failed, error: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions failed, error: ' + JSON.stringify(err));
});
} catch (err) {
- console.log("selectAccountsByOptions exception: " + JSON.stringify(err));
+ console.log('selectAccountsByOptions exception: ' + JSON.stringify(err));
}
```
@@ -2554,17 +2554,17 @@ Verifies the credential of an app account. This API uses an asynchronous callbac
```js
try {
- appAccountManager.verifyCredential("zhangsan", "com.example.accountjsdemo", {
+ appAccountManager.verifyCredential('zhangsan', 'com.example.accountjsdemo', {
onResult: (resultCode, result) => {
- console.log("verifyCredential onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("verifyCredential onResult, result:" + JSON.stringify(result));
+ console.log('verifyCredential onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('verifyCredential onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("verifyCredential onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('verifyCredential onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("verifyCredential err: " + JSON.stringify(err));
+ console.log('verifyCredential err: ' + JSON.stringify(err));
}
```
@@ -2600,21 +2600,21 @@ Verifies the user credential. This API uses an asynchronous callback to return t
```js
let options = {
- credentialType: "pin",
- credential: "123456"
+ credentialType: 'pin',
+ credential: '123456'
};
try {
- appAccountManager.verifyCredential("zhangsan", "com.example.accountjsdemo", options, {
+ appAccountManager.verifyCredential('zhangsan', 'com.example.accountjsdemo', options, {
onResult: (resultCode, result) => {
- console.log("verifyCredential onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("verifyCredential onResult, result:" + JSON.stringify(result));
+ console.log('verifyCredential onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('verifyCredential onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("verifyCredential onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('verifyCredential onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("verifyCredential err: " + JSON.stringify(err));
+ console.log('verifyCredential err: ' + JSON.stringify(err));
}
```
@@ -2647,17 +2647,17 @@ Sets the authenticator attributes of an app. This API uses an asynchronous callb
```js
try {
- appAccountManager.setAuthenticatorProperties("com.example.accountjsdemo", {
+ appAccountManager.setAuthenticatorProperties('com.example.accountjsdemo', {
onResult: (resultCode, result) => {
- console.log("setAuthenticatorProperties onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("setAuthenticatorProperties onResult, result:" + JSON.stringify(result));
+ console.log('setAuthenticatorProperties onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('setAuthenticatorProperties onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("setAuthenticatorProperties onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('setAuthenticatorProperties onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("setAuthenticatorProperties err: " + JSON.stringify(err));
+ console.log('setAuthenticatorProperties err: ' + JSON.stringify(err));
}
```
@@ -2691,20 +2691,20 @@ Set authenticator properties. This API uses an asynchronous callback to return t
```js
let options = {
- properties: {"prop1": "value1"}
+ properties: {'prop1': 'value1'}
};
try {
- appAccountManager.setAuthenticatorProperties("com.example.accountjsdemo", options, {
+ appAccountManager.setAuthenticatorProperties('com.example.accountjsdemo', options, {
onResult: (resultCode, result) => {
- console.log("setAuthenticatorProperties onResult, resultCode:" + JSON.stringify(resultCode));
- console.log("setAuthenticatorProperties onResult, result:" + JSON.stringify(result));
+ console.log('setAuthenticatorProperties onResult, resultCode: ' + JSON.stringify(resultCode));
+ console.log('setAuthenticatorProperties onResult, result: ' + JSON.stringify(result));
},
onRequestRedirected: (request) => {
- console.log("setAuthenticatorProperties onRequestRedirected, request:" + JSON.stringify(request));
+ console.log('setAuthenticatorProperties onRequestRedirected, request: ' + JSON.stringify(request));
}
});
} catch (err) {
- console.log("setAuthenticatorProperties err: " + JSON.stringify(err));
+ console.log('setAuthenticatorProperties err: ' + JSON.stringify(err));
}
```
@@ -2732,8 +2732,8 @@ Adds an app account. This API uses an asynchronous callback to return the result
**Example**
```js
- appAccountManager.addAccount("WangWu", (err) => {
- console.log("addAccount err: " + JSON.stringify(err));
+ appAccountManager.addAccount('WangWu', (err) => {
+ console.log('addAccount err: ' + JSON.stringify(err));
});
```
@@ -2744,7 +2744,6 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>)
Adds an app account name and additional information. This API uses an asynchronous callback to return the result.
> **NOTE**
->
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createAccount](#createaccount9-1).
**System capability**: SystemCapability.Account.AppAccount
@@ -2760,8 +2759,8 @@ Adds an app account name and additional information. This API uses an asynchrono
**Example**
```js
- appAccountManager.addAccount("LiSi", "token101", (err) => {
- console.log("addAccount err: " + JSON.stringify(err));
+ appAccountManager.addAccount('LiSi', 'token101', (err) => {
+ console.log('addAccount err: ' + JSON.stringify(err));
});
```
@@ -2771,8 +2770,7 @@ addAccount(name: string, extraInfo?: string): Promise<void>
Adds an app account name and additional information. This API uses an asynchronous callback to return the result. This API uses a promise to return the result.
-> **NOTE**
->
+> **NOTE**
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createAccount](#createaccount9-2).
**System capability**: SystemCapability.Account.AppAccount
@@ -2782,7 +2780,7 @@ Adds an app account name and additional information. This API uses an asynchrono
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ---------------------------------------- |
| name | string | Yes | Name of the target app account. |
-| extraInfo | string | No | Additional information (information that can be converted to the string type). It cannot contain sensitive information, such as the app account password and token.|
+| extraInfo | string | No | Additional information (information that can be converted to the string type). The additional information cannot be sensitive information (such as the password and token) of the app account. By default, no value is passed, which means no additional information needs to be added for the account.|
**Return value**
@@ -2793,10 +2791,10 @@ Adds an app account name and additional information. This API uses an asynchrono
**Example**
```js
- appAccountManager.addAccount("LiSi", "token101").then(()=> {
+ appAccountManager.addAccount('LiSi', 'token101').then(()=> {
console.log('addAccount Success');
}).catch((err) => {
- console.log("addAccount err: " + JSON.stringify(err));
+ console.log('addAccount err: ' + JSON.stringify(err));
});
```
@@ -2827,8 +2825,8 @@ Adds an app account implicitly based on the specified owner. This API uses an as
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -2839,13 +2837,13 @@ Adds an app account implicitly based on the specified owner. This API uses an as
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
- appAccountManager.addAccountImplicitly("com.example.accountjsdemo", "getSocialData", {}, {
+ appAccountManager.addAccountImplicitly('com.example.accountjsdemo', 'getSocialData', {}, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
@@ -2873,8 +2871,8 @@ Deletes an app account. This API uses an asynchronous callback to return the res
**Example**
```js
- appAccountManager.deleteAccount("ZhaoLiu", (err) => {
- console.log("deleteAccount err: " + JSON.stringify(err));
+ appAccountManager.deleteAccount('ZhaoLiu', (err) => {
+ console.log('deleteAccount err: ' + JSON.stringify(err));
});
```
@@ -2905,10 +2903,10 @@ Deletes an app account. This API uses a promise to return the result.
**Example**
```js
- appAccountManager.deleteAccount("ZhaoLiu").then(() => {
+ appAccountManager.deleteAccount('ZhaoLiu').then(() => {
console.log('deleteAccount Success');
}).catch((err) => {
- console.log("deleteAccount err: " + JSON.stringify(err));
+ console.log('deleteAccount err: ' + JSON.stringify(err));
});
```
### disableAppAccess(deprecated)
@@ -2934,8 +2932,8 @@ Disables an app account from accessing an app. This API uses an asynchronous cal
**Example**
```js
- appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => {
- console.log("disableAppAccess err: " + JSON.stringify(err));
+ appAccountManager.disableAppAccess('ZhangSan', 'com.example.accountjsdemo', (err) => {
+ console.log('disableAppAccess err: ' + JSON.stringify(err));
});
```
@@ -2967,10 +2965,10 @@ Disables an app account from accessing an app. This API uses a promise to return
**Example**
```js
- appAccountManager.disableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => {
+ appAccountManager.disableAppAccess('ZhangSan', 'com.example.accountjsdemo').then(() => {
console.log('disableAppAccess Success');
}).catch((err) => {
- console.log("disableAppAccess err: " + JSON.stringify(err));
+ console.log('disableAppAccess err: ' + JSON.stringify(err));
});
```
@@ -2997,8 +2995,8 @@ Enables an app account to access an app. This API uses an asynchronous callback
**Example**
```js
- appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo", (err) => {
- console.log("enableAppAccess: " + JSON.stringify(err));
+ appAccountManager.enableAppAccess('ZhangSan', 'com.example.accountjsdemo', (err) => {
+ console.log('enableAppAccess: ' + JSON.stringify(err));
});
```
@@ -3030,10 +3028,10 @@ Enables an app account to access an app. This API uses a promise to return the r
**Example**
```js
- appAccountManager.enableAppAccess("ZhangSan", "com.example.accountjsdemo").then(() => {
+ appAccountManager.enableAppAccess('ZhangSan', 'com.example.accountjsdemo').then(() => {
console.log('enableAppAccess Success');
}).catch((err) => {
- console.log("enableAppAccess err: " + JSON.stringify(err));
+ console.log('enableAppAccess err: ' + JSON.stringify(err));
});
```
@@ -3061,8 +3059,8 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- appAccountManager.checkAppAccountSyncEnable("ZhangSan", (err, result) => {
- console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err));
+ appAccountManager.checkAppAccountSyncEnable('ZhangSan', (err, result) => {
+ console.log('checkAppAccountSyncEnable err: ' + JSON.stringify(err));
console.log('checkAppAccountSyncEnable result: ' + result);
});
```
@@ -3096,10 +3094,10 @@ Checks whether data synchronization is enabled for an app account. This API uses
**Example**
```js
- appAccountManager.checkAppAccountSyncEnable("ZhangSan").then((data) => {
+ appAccountManager.checkAppAccountSyncEnable('ZhangSan').then((data) => {
console.log('checkAppAccountSyncEnable, result: ' + data);
}).catch((err) => {
- console.log("checkAppAccountSyncEnable err: " + JSON.stringify(err));
+ console.log('checkAppAccountSyncEnable err: ' + JSON.stringify(err));
});
```
@@ -3127,8 +3125,8 @@ Set credentials for an app account. This API uses an asynchronous callback to re
**Example**
```js
- appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001", (err) => {
- console.log("setAccountCredential err: " + JSON.stringify(err));
+ appAccountManager.setAccountCredential('ZhangSan', 'credentialType001', 'credential001', (err) => {
+ console.log('setAccountCredential err: ' + JSON.stringify(err));
});
```
@@ -3161,10 +3159,10 @@ Set credentials for an app account. This API uses a promise to return the result
**Example**
```js
- appAccountManager.setAccountCredential("ZhangSan", "credentialType001", "credential001").then(() => {
+ appAccountManager.setAccountCredential('ZhangSan', 'credentialType001', 'credential001').then(() => {
console.log('setAccountCredential Success');
}).catch((err) => {
- console.log("setAccountCredential err: " + JSON.stringify(err));
+ console.log('setAccountCredential err: ' + JSON.stringify(err));
});
```
@@ -3192,8 +3190,8 @@ Sets additional information for an app account. This API uses an asynchronous ca
**Example**
```js
- appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002", (err) => {
- console.log("setAccountExtraInfo err: " + JSON.stringify(err));
+ appAccountManager.setAccountExtraInfo('ZhangSan', 'Tk002', (err) => {
+ console.log('setAccountExtraInfo err: ' + JSON.stringify(err));
});
```
@@ -3226,10 +3224,10 @@ Sets additional information for an app account. This API uses a promise to retur
**Example**
```js
- appAccountManager.setAccountExtraInfo("ZhangSan", "Tk002").then(() => {
+ appAccountManager.setAccountExtraInfo('ZhangSan', 'Tk002').then(() => {
console.log('setAccountExtraInfo Success');
}).catch((err) => {
- console.log("setAccountExtraInfo err: " + JSON.stringify(err));
+ console.log('setAccountExtraInfo err: ' + JSON.stringify(err));
});
```
@@ -3258,8 +3256,8 @@ Sets data synchronization for an app account. This API uses an asynchronous call
**Example**
```js
- appAccountManager.setAppAccountSyncEnable("ZhangSan", true, (err) => {
- console.log("setAppAccountSyncEnable err: " + JSON.stringify(err));
+ appAccountManager.setAppAccountSyncEnable('ZhangSan', true, (err) => {
+ console.log('setAppAccountSyncEnable err: ' + JSON.stringify(err));
});
```
@@ -3293,10 +3291,10 @@ Sets data synchronization for an app account. This API uses a promise to return
**Example**
```js
- appAccountManager .setAppAccountSyncEnable("ZhangSan", true).then(() => {
+ appAccountManager .setAppAccountSyncEnable('ZhangSan', true).then(() => {
console.log('setAppAccountSyncEnable Success');
}).catch((err) => {
- console.log("setAppAccountSyncEnable err: " + JSON.stringify(err));
+ console.log('setAppAccountSyncEnable err: ' + JSON.stringify(err));
});
```
@@ -3325,8 +3323,8 @@ Sets data to be associated with an app account. This API uses an asynchronous ca
**Example**
```js
- appAccountManager.setAssociatedData("ZhangSan", "k001", "v001", (err) => {
- console.log("setAssociatedData err: " + JSON.stringify(err));
+ appAccountManager.setAssociatedData('ZhangSan', 'k001', 'v001', (err) => {
+ console.log('setAssociatedData err: ' + JSON.stringify(err));
});
```
@@ -3360,10 +3358,10 @@ Sets data to be associated with an app account. This API uses a promise to retur
**Example**
```js
- appAccountManager.setAssociatedData("ZhangSan", "k001", "v001").then(() => {
+ appAccountManager.setAssociatedData('ZhangSan', 'k001', 'v001').then(() => {
console.log('setAssociatedData Success');
}).catch((err) => {
- console.log("setAssociatedData err: " + JSON.stringify(err));
+ console.log('setAssociatedData err: ' + JSON.stringify(err));
});
```
@@ -3391,8 +3389,8 @@ Obtains information about all accessible app accounts. This API uses an asynchro
```js
appAccountManager.getAllAccessibleAccounts((err, data)=>{
- console.debug("getAllAccessibleAccounts err:" + JSON.stringify(err));
- console.debug("getAllAccessibleAccounts data:" + JSON.stringify(data));
+ console.debug('getAllAccessibleAccounts err: ' + JSON.stringify(err));
+ console.debug('getAllAccessibleAccounts data: ' + JSON.stringify(data));
});
```
@@ -3422,7 +3420,7 @@ Obtains information about all accessible app accounts. This API uses a promise t
appAccountManager.getAllAccessibleAccounts().then((data) => {
console.log('getAllAccessibleAccounts: ' + data);
}).catch((err) => {
- console.log("getAllAccessibleAccounts err: " + JSON.stringify(err));
+ console.log('getAllAccessibleAccounts err: ' + JSON.stringify(err));
});
```
@@ -3450,10 +3448,10 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- const selfBundle = "com.example.actsgetallaaccounts";
+ const selfBundle = 'com.example.actsgetallaaccounts';
appAccountManager.getAllAccounts(selfBundle, (err, data)=>{
- console.debug("getAllAccounts err:" + JSON.stringify(err));
- console.debug("getAllAccounts data:" + JSON.stringify(data));
+ console.debug('getAllAccounts err: ' + JSON.stringify(err));
+ console.debug('getAllAccounts data:' + JSON.stringify(data));
});
```
@@ -3486,11 +3484,11 @@ Obtains the app accounts that can be accessed by the invoker based on the app ac
**Example**
```js
- const selfBundle = "com.example.actsgetallaaccounts";
+ const selfBundle = 'com.example.actsgetallaaccounts';
appAccountManager.getAllAccounts(selfBundle).then((data) => {
console.log('getAllAccounts: ' + data);
}).catch((err) => {
- console.log("getAllAccounts err: " + JSON.stringify(err));
+ console.log('getAllAccounts err: ' + JSON.stringify(err));
});
```
@@ -3517,8 +3515,8 @@ Obtains the credential of an app account. This API uses an asynchronous callback
**Example**
```js
- appAccountManager.getAccountCredential("ZhangSan", "credentialType001", (err, result) => {
- console.log("getAccountCredential err: " + JSON.stringify(err));
+ appAccountManager.getAccountCredential('ZhangSan', 'credentialType001', (err, result) => {
+ console.log('getAccountCredential err: ' + JSON.stringify(err));
console.log('getAccountCredential result: ' + result);
});
```
@@ -3551,10 +3549,10 @@ Obtains the credential of an app account. This API uses a promise to return the
**Example**
```js
- appAccountManager.getAccountCredential("ZhangSan", "credentialType001").then((data) => {
+ appAccountManager.getAccountCredential('ZhangSan', 'credentialType001').then((data) => {
console.log('getAccountCredential, result: ' + data);
}).catch((err) => {
- console.log("getAccountCredential err: " + JSON.stringify(err));
+ console.log('getAccountCredential err: ' + JSON.stringify(err));
});
```
@@ -3580,8 +3578,8 @@ Obtains additional information of an app account. Additional information refers
**Example**
```js
- appAccountManager.getAccountExtraInfo("ZhangSan", (err, result) => {
- console.log("getAccountExtraInfo err: " + JSON.stringify(err));
+ appAccountManager.getAccountExtraInfo('ZhangSan', (err, result) => {
+ console.log('getAccountExtraInfo err: ' + JSON.stringify(err));
console.log('getAccountExtraInfo result: ' + result);
});
```
@@ -3613,10 +3611,10 @@ Obtains additional information of an app account. Additional information refers
**Example**
```js
- appAccountManager.getAccountExtraInfo("ZhangSan").then((data) => {
+ appAccountManager.getAccountExtraInfo('ZhangSan').then((data) => {
console.log('getAccountExtraInfo, result: ' + data);
}).catch((err) => {
- console.log("getAccountExtraInfo err: " + JSON.stringify(err));
+ console.log('getAccountExtraInfo err: ' + JSON.stringify(err));
});
```
@@ -3643,8 +3641,8 @@ Obtains data associated with an app account. This API uses an asynchronous callb
**Example**
```js
- appAccountManager.getAssociatedData("ZhangSan", "k001", (err, result) => {
- console.log("getAssociatedData err: " + JSON.stringify(err));
+ appAccountManager.getAssociatedData('ZhangSan', 'k001', (err, result) => {
+ console.log('getAssociatedData err: ' + JSON.stringify(err));
console.log('getAssociatedData result: ' + result);
});
```
@@ -3677,10 +3675,10 @@ Obtains data associated with an app account. This API uses a promise to return t
**Example**
```js
- appAccountManager.getAssociatedData("ZhangSan", "k001").then((data) => {
+ appAccountManager.getAssociatedData('ZhangSan', 'k001').then((data) => {
console.log('getAssociatedData: ' + data);
}).catch((err) => {
- console.log("getAssociatedData err: " + JSON.stringify(err));
+ console.log('getAssociatedData err: ' + JSON.stringify(err));
});
```
@@ -3702,19 +3700,19 @@ Subscribes to account information changes of apps.
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | 'change' | Yes | Event type to subscribe to. The value is **'change'**. An event will be reported when the account information changes.|
| owners | Array<string> | Yes | App bundle names of the account. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback invoked to return the account changes. |
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | Yes | Callback registered to return the list of changed app accounts. |
**Example**
```js
function changeOnCallback(data){
- console.debug("receive change data:" + JSON.stringify(data));
+ console.debug('receive change data:' + JSON.stringify(data));
}
try{
- appAccountManager.on('change', ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('change', ['com.example.actsaccounttest'], changeOnCallback);
}
catch(err){
- console.error("on accountOnOffDemo err:" + JSON.stringify(err));
+ console.error('on accountOnOffDemo err:' + JSON.stringify(err));
}
```
@@ -3735,22 +3733,22 @@ Unsubscribes from account information changes.
| Name | Type | Mandatory | Description |
| -------- | -------------------------------- | ---- | ------------ |
| type | 'change' | Yes | Event type to unsubscribe from. The value is **'change'**, which indicates the account change event. |
-| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister.|
+| callback | Callback<Array<[AppAccountInfo](#appaccountinfo)>> | No | Callback to unregister. By default, no value is passed, which means to unregister all callbacks for the specified event.|
**Example**
```js
function changeOnCallback(data){
- console.debug("receive change data:" + JSON.stringify(data));
+ console.debug('receive change data: ' + JSON.stringify(data));
appAccountManager.off('change', function(){
- console.debug("off finish");
+ console.debug('off finish');
})
}
try{
- appAccountManager.on('change', ["com.example.actsaccounttest"], changeOnCallback);
+ appAccountManager.on('change', ['com.example.actsaccounttest'], changeOnCallback);
}
catch(err){
- console.error("on accountOnOffDemo err:" + JSON.stringify(err));
+ console.error('on accountOnOffDemo err: ' + JSON.stringify(err));
}
```
@@ -3780,8 +3778,8 @@ Authenticates an app account with customized options. This API uses an asynchron
```js
function onResultCallback(code, result) {
- console.log("resultCode: " + code);
- console.log("result: " + JSON.stringify(result));
+ console.log('resultCode: ' + code);
+ console.log('result: ' + JSON.stringify(result));
}
function onRequestRedirectedCallback(request) {
@@ -3792,13 +3790,13 @@ Authenticates an app account with customized options. This API uses an asynchron
entities: ['entity.system.default'],
}
this.context.startAbility(wantInfo).then(() => {
- console.log("startAbility successfully");
+ console.log('startAbility successfully');
}).catch((err) => {
- console.log("startAbility err: " + JSON.stringify(err));
+ console.log('startAbility err: ' + JSON.stringify(err));
})
}
- appAccountManager.authenticate("LiSi", "com.example.accountjsdemo", "getSocialData", {}, {
+ appAccountManager.authenticate('LiSi', 'com.example.accountjsdemo', 'getSocialData', {}, {
onResult: onResultCallback,
onRequestRedirected: onRequestRedirectedCallback
});
@@ -3828,7 +3826,7 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", (err, data) => {
+ appAccountManager.getOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', (err, data) => {
console.log('getOAuthToken err: ' + JSON.stringify(err));
console.log('getOAuthToken token: ' + data);
});
@@ -3863,10 +3861,10 @@ Obtains the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.getOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData").then((data) => {
+ appAccountManager.getOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData').then((data) => {
console.log('getOAuthToken token: ' + data);
}).catch((err) => {
- console.log("getOAuthToken err: " + JSON.stringify(err));
+ console.log('getOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -3894,7 +3892,7 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx", (err) => {
+ appAccountManager.setOAuthToken('LiSi', 'getSocialData', 'xxxx', (err) => {
console.log('setOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -3928,7 +3926,7 @@ Sets an authorization token of the specific authentication type for an app accou
**Example**
```js
- appAccountManager.setOAuthToken("LiSi", "getSocialData", "xxxx").then(() => {
+ appAccountManager.setOAuthToken('LiSi', 'getSocialData', 'xxxx').then(() => {
console.log('setOAuthToken successfully');
}).catch((err) => {
console.log('setOAuthToken err: ' + JSON.stringify(err));
@@ -3960,7 +3958,7 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx", (err) => {
+ appAccountManager.deleteOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx', (err) => {
console.log('deleteOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -3995,10 +3993,10 @@ Deletes the authorization token of the specified authentication type for an app
**Example**
```js
- appAccountManager.deleteOAuthToken("LiSi", "com.example.accountjsdemo", "getSocialData", "xxxxx").then(() => {
+ appAccountManager.deleteOAuthToken('LiSi', 'com.example.accountjsdemo', 'getSocialData', 'xxxxx').then(() => {
console.log('deleteOAuthToken successfully');
}).catch((err) => {
- console.log("deleteOAuthToken err: " + JSON.stringify(err));
+ console.log('deleteOAuthToken err: ' + JSON.stringify(err));
});
```
@@ -4027,7 +4025,7 @@ Sets the visibility of an authorization token to an app. This API uses an asynch
**Example**
```js
- appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true, (err) => {
+ appAccountManager.setOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true, (err) => {
console.log('setOAuthTokenVisibility err: ' + JSON.stringify(err));
});
```
@@ -4062,7 +4060,7 @@ Sets the visibility of an authorization token to an app. This API uses a promise
**Example**
```js
- appAccountManager.setOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", true).then(() => {
+ appAccountManager.setOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', true).then(() => {
console.log('setOAuthTokenVisibility successfully');
}).catch((err) => {
console.log('setOAuthTokenVisibility err: ' + JSON.stringify(err));
@@ -4093,7 +4091,7 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo", (err, data) => {
+ appAccountManager.checkOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo', (err, data) => {
console.log('checkOAuthTokenVisibility err: ' + JSON.stringify(err));
console.log('checkOAuthTokenVisibility isVisible: ' + data);
});
@@ -4128,7 +4126,7 @@ Checks the visibility of an authorization token of the specified authentication
**Example**
```js
- appAccountManager.checkOAuthTokenVisibility("LiSi", "getSocialData", "com.example.accountjsdemo").then((data) => {
+ appAccountManager.checkOAuthTokenVisibility('LiSi', 'getSocialData', 'com.example.accountjsdemo').then((data) => {
console.log('checkOAuthTokenVisibility isVisible: ' + data);
}).catch((err) => {
console.log('checkOAuthTokenVisibility err: ' + JSON.stringify(err));
@@ -4158,8 +4156,8 @@ Obtains all tokens visible to the invoker for an app account. This API uses an a
**Example**
```js
- appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo", (err, data) => {
- console.log("getAllOAuthTokens err: " + JSON.stringify(err));
+ appAccountManager.getAllOAuthTokens('LiSi', 'com.example.accountjsdemo', (err, data) => {
+ console.log('getAllOAuthTokens err: ' + JSON.stringify(err));
console.log('getAllOAuthTokens data: ' + JSON.stringify(data));
});
```
@@ -4192,10 +4190,10 @@ Obtains all tokens visible to the invoker for an app account. This API uses a pr
**Example**
```js
- appAccountManager.getAllOAuthTokens("LiSi", "com.example.accountjsdemo").then((data) => {
+ appAccountManager.getAllOAuthTokens('LiSi', 'com.example.accountjsdemo').then((data) => {
console.log('getAllOAuthTokens data: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getAllOAuthTokens err: " + JSON.stringify(err));
+ console.log('getAllOAuthTokens err: ' + JSON.stringify(err));
});
```
@@ -4222,7 +4220,7 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData", (err, data) => {
+ appAccountManager.getOAuthList('LiSi', 'getSocialData', (err, data) => {
console.log('getOAuthList err: ' + JSON.stringify(err));
console.log('getOAuthList data: ' + JSON.stringify(data));
});
@@ -4256,10 +4254,10 @@ Obtains the authorization list of the specified authentication type for an app a
**Example**
```js
- appAccountManager.getOAuthList("com.example.accountjsdemo", "getSocialData").then((data) => {
+ appAccountManager.getOAuthList('LiSi', 'getSocialData').then((data) => {
console.log('getOAuthList data: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getOAuthList err: " + JSON.stringify(err));
+ console.log('getOAuthList err: ' + JSON.stringify(err));
});
```
@@ -4292,13 +4290,13 @@ Obtains the authenticator callback for an authentication session. This API uses
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
appAccountManager.getAuthenticatorCallback(sessionId, (err, callback) => {
if (err.code != account_appAccount.ResultCode.SUCCESS) {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
return;
}
- var result = {[account_appAccount.Constants.KEY_NAME]: "LiSi",
- [account_appAccount.Constants.KEY_OWNER]: "com.example.accountjsdemo",
- [account_appAccount.Constants.KEY_AUTH_TYPE]: "getSocialData",
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ var result = {[account_appAccount.Constants.KEY_NAME]: 'LiSi',
+ [account_appAccount.Constants.KEY_OWNER]: 'com.example.accountjsdemo',
+ [account_appAccount.Constants.KEY_AUTH_TYPE]: 'getSocialData',
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
});
}
@@ -4338,13 +4336,13 @@ Obtains the authenticator callback for an authentication session. This API uses
onCreate(want, param) {
var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID];
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
- var result = {[account_appAccount.Constants.KEY_NAME]: "LiSi",
- [account_appAccount.Constants.KEY_OWNER]: "com.example.accountjsdemo",
- [account_appAccount.Constants.KEY_AUTH_TYPE]: "getSocialData",
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ var result = {[account_appAccount.Constants.KEY_NAME]: 'LiSi',
+ [account_appAccount.Constants.KEY_OWNER]: 'com.example.accountjsdemo',
+ [account_appAccount.Constants.KEY_AUTH_TYPE]: 'getSocialData',
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}).catch((err) => {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
});
}
}
@@ -4372,8 +4370,8 @@ Obtains the authenticator information of an app. This API uses an asynchronous c
**Example**
```js
- appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo", (err, data) => {
- console.log("getAuthenticatorInfo err: " + JSON.stringify(err));
+ appAccountManager.getAuthenticatorInfo('com.example.accountjsdemo', (err, data) => {
+ console.log('getAuthenticatorInfo err: ' + JSON.stringify(err));
console.log('getAuthenticatorInfo data: ' + JSON.stringify(data));
});
```
@@ -4405,10 +4403,10 @@ Obtains the authenticator information of an app. This API uses a promise to retu
**Example**
```js
- appAccountManager.getAuthenticatorInfo("com.example.accountjsdemo").then((data) => {
+ appAccountManager.getAuthenticatorInfo('com.example.accountjsdemo').then((data) => {
console.log('getAuthenticatorInfo: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getAuthenticatorInfo err: " + JSON.stringify(err));
+ console.log('getAuthenticatorInfo err: ' + JSON.stringify(err));
});
```
@@ -4433,7 +4431,7 @@ Defines authorization token information.
| -------------------- | -------------- | ----- | ---------------- |
| authType9+ | string | Yes | Authentication type. |
| token9+ | string | Yes | Value of the authorization token. |
-| account9+ | [AppAccountInfo](#appaccountinfo) | No | Account information of the authorization token.|
+| account9+ | [AppAccountInfo](#appaccountinfo) | No | Information about the account to which the token belongs. By default, no value is passed.|
## OAuthTokenInfo(deprecated)
@@ -4449,7 +4447,7 @@ Defines authorization token information.
| -------------------- | -------------- | ----- | ---------------- |
| authType | string | Yes | Authentication type. |
| token | string | Yes | Value of the authorization token. |
-| account9+ | [AppAccountInfo](#appaccountinfo) | No | Account information of the authorization token.|
+| account9+ | [AppAccountInfo](#appaccountinfo) | No | Information about the account to which the token belongs. By default, no value is passed.|
## AuthenticatorInfo8+
@@ -4471,8 +4469,8 @@ Defines the authentication result.
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------- |
-| account | [AppAccountInfo](#appaccountinfo) | No | Account information of the authorization token.|
-| tokenInfo | [AuthTokenInfo](#authtokeninfo9) | No | Token information. |
+| account | [AppAccountInfo](#appaccountinfo) | No | Information about the account to which the token belongs. By default, no value is passed.|
+| tokenInfo | [AuthTokenInfo](#authtokeninfo9) | No | Token information. By default, no value is passed. |
## CreateAccountOptions9+
@@ -4482,7 +4480,7 @@ Defines the options for creating an app account.
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------- |
-| customData | {[key: string]: string} | No | Custom data.|
+| customData | {[key: string]: string} | No | Custom data. By default, no value is passed.|
## CreateAccountImplicitlyOptions9+
@@ -4492,9 +4490,9 @@ Defines the options for implicitly creating an app account.
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | ---------- |
-| requiredLabels | Array<string> | No | Labels required.|
-| authType | string | No | Authentication type.|
-| parameters | {[key: string]: Object} | No | Customized parameters.|
+| requiredLabels | Array<string> | No | Required labels. By default, no value is passed.|
+| authType | string | No | Authentication type. By default, no value is passed.|
+| parameters | {[key: string]: Object} | No | Custom parameter object. By default, no value is passed.|
## SelectAccountsOptions9+
Defines the options for selecting accounts.
@@ -4503,9 +4501,9 @@ Defines the options for selecting accounts.
| Name | Type | Mandatory | Description |
| --------------- | --------------------------- | ----- | ------------------- |
-| allowedAccounts | Array<[AppAccountInfo](#appaccountinfo)> | No | Allowed accounts. |
-| allowedOwners | Array<string> | No | Allowed account owners.|
-| requiredLabels | Array<string> | No | Labels required for the authenticator. |
+| allowedAccounts | Array<[AppAccountInfo](#appaccountinfo)> | No | Array of allowed accounts. By default, no value is passed. |
+| allowedOwners | Array<string> | No | Array of the owners of the allowed accounts. By default, no value is passed.|
+| requiredLabels | Array<string> | No | Labels of the authenticator. By default, no value is passed. |
## VerifyCredentialOptions9+
@@ -4515,9 +4513,9 @@ Represents the options for verifying the user credential.
| Name | Type | Mandatory | Description |
| -------------- | ---------------------- | ----- | -------------- |
-| credentialType | string | No | Type of the credential to verify. |
-| credential | string | No | Credential value. |
-| parameters | {[key: string]: Object} | No | Customized parameters.|
+| credentialType | string | No | Credential type. By default, no value is passed. |
+| credential | string | No | Credential value. By default, no value is passed. |
+| parameters | {[key: string]: Object} | No | Custom parameter object. By default, no value is passed.|
## SetPropertiesOptions9+
@@ -4528,8 +4526,8 @@ Represents the options for setting authenticator properties.
| Name | Type | Mandatory | Description |
| ---------- | ---------------------- | ----- | -------------- |
-| properties | {[key: string]: Object} | No | Authenticator properties. |
-| parameters | {[key: string]: Object} | No | Customized parameters.|
+| properties | {[key: string]: Object} | No | Property object. By default, no value is passed. |
+| parameters | {[key: string]: Object} | No | Custom parameter object. By default, no value is passed.|
## Constants8+
@@ -4539,23 +4537,23 @@ Enumerates the constants.
| Name | Value | Description |
| -------------------------------- | ---------------------- | ----------------------- |
-| ACTION_ADD_ACCOUNT_IMPLICITLY(deprecated) | "addAccountImplicitly" | Operation of adding an account implicitly. |
-| ACTION_AUTHENTICATE(deprecated) | "authenticate" | Authentication operation. |
-| ACTION_CREATE_ACCOUNT_IMPLICITLY9+ | "createAccountImplicitly" | Operation of creating an account implicitly. |
-| ACTION_AUTH9+ | "auth" | Authentication operation. |
-| ACTION_VERIFY_CREDENTIAL9+ | "verifyCredential" | Operation of verifying credentials. |
-| ACTION_SET_AUTHENTICATOR_PROPERTIES9+ | "setAuthenticatorProperties" | Operation of setting authenticator properties. |
-| KEY_NAME | "name" | Name of the app account. |
-| KEY_OWNER | "owner" | Owner of the app account.|
-| KEY_TOKEN | "token" | Token. |
-| KEY_ACTION | "action" | Operation. |
-| KEY_AUTH_TYPE | "authType" | Authentication type. |
-| KEY_SESSION_ID | "sessionId" | Session ID. |
-| KEY_CALLER_PID | "callerPid" | PID of the caller. |
-| KEY_CALLER_UID | "callerUid" | UID of the caller. |
-| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | Bundle name of the caller. |
-| KEY_REQUIRED_LABELS9+ | "requiredLabels" | Required labels. |
-| KEY_BOOLEAN_RESULT9+ | "booleanResult" | Return value of the Boolean type. |
+| ACTION_ADD_ACCOUNT_IMPLICITLY(deprecated) | 'addAccountImplicitly' | Operation of adding an account implicitly. |
+| ACTION_AUTHENTICATE(deprecated) | 'authenticate' | Authentication operation. |
+| ACTION_CREATE_ACCOUNT_IMPLICITLY9+ | 'createAccountImplicitly' | Operation of creating an account implicitly. |
+| ACTION_AUTH9+ | 'auth' | Authentication operation. |
+| ACTION_VERIFY_CREDENTIAL9+ | 'verifyCredential' | Operation of verifying credentials. |
+| ACTION_SET_AUTHENTICATOR_PROPERTIES9+ | 'setAuthenticatorProperties' | Operation of setting authenticator properties. |
+| KEY_NAME | 'name' | Name of the app account. |
+| KEY_OWNER | 'owner' | Owner of the app account.|
+| KEY_TOKEN | 'token' | Token. |
+| KEY_ACTION | 'action' | Operation. |
+| KEY_AUTH_TYPE | 'authType' | Authentication type. |
+| KEY_SESSION_ID | 'sessionId' | Session ID. |
+| KEY_CALLER_PID | 'callerPid' | PID of the caller. |
+| KEY_CALLER_UID | 'callerUid' | UID of the caller. |
+| KEY_CALLER_BUNDLE_NAME | 'callerBundleName' | Bundle name of the caller. |
+| KEY_REQUIRED_LABELS9+ | 'requiredLabels' | Required labels. |
+| KEY_BOOLEAN_RESULT9+ | 'booleanResult' | Return value of the Boolean type. |
## ResultCode(deprecated)
@@ -4606,27 +4604,27 @@ Called to return the result of an authentication request.
| Name | Type | Mandatory | Description |
| ------ | -------------------- | ---- | ------ |
| code | number | Yes | Authentication result code.|
-| result | [AuthResult](#authresult9) | No | Authentication result. |
+| result | [AuthResult](#authresult9) | No | Authentication result. By default, no value is passed, which means the authentication result is not received. |
**Example**
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthCallback(sessionId).then((callback) => {
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}).catch((err) => {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
});
```
@@ -4650,20 +4648,20 @@ Called to redirect a request.
class MyAuthenticator extends account_appAccount.Authenticator {
createAccountImplicitly(options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.LoginAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.LoginAbility',
});
}
auth(name, authType, options, callback) {
var result = {
accountInfo: {
- name: "Lisi",
- owner: "com.example.accountjsdemo",
+ name: 'Lisi',
+ owner: 'com.example.accountjsdemo',
},
tokenInfo: {
- token: "xxxxxx",
- authType: "getSocialData"
+ token: 'xxxxxx',
+ authType: 'getSocialData'
}
};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
@@ -4683,11 +4681,11 @@ Called to continue to process the request.
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthCallback(sessionId).then((callback) => {
callback.onRequestContinued();
}).catch((err) => {
- console.log("getAuthCallback err: " + JSON.stringify(err));
+ console.log('getAuthCallback err: ' + JSON.stringify(err));
});
```
@@ -4718,15 +4716,15 @@ Called to return the result of an authentication request.
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
- var result = {[account_appAccount.Constants.KEY_NAME]: "LiSi",
- [account_appAccount.Constants.KEY_OWNER]: "com.example.accountjsdemo",
- [account_appAccount.Constants.KEY_AUTH_TYPE]: "getSocialData",
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ var result = {[account_appAccount.Constants.KEY_NAME]: 'LiSi',
+ [account_appAccount.Constants.KEY_OWNER]: 'com.example.accountjsdemo',
+ [account_appAccount.Constants.KEY_AUTH_TYPE]: 'getSocialData',
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}).catch((err) => {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
});
```
@@ -4750,15 +4748,15 @@ Called to redirect a request.
class MyAuthenticator extends account_appAccount.Authenticator {
addAccountImplicitly(authType, callerBundleName, options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.LoginAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.LoginAbility',
});
}
authenticate(name, authType, callerBundleName, options, callback) {
var result = {[account_appAccount.Constants.KEY_NAME]: name,
[account_appAccount.Constants.KEY_AUTH_TYPE]: authType,
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}
}
@@ -4776,11 +4774,11 @@ Called to continue to process the request.
```js
let appAccountManager = account_appAccount.createAppAccountManager();
- var sessionId = "1234";
+ var sessionId = '1234';
appAccountManager.getAuthenticatorCallback(sessionId).then((callback) => {
callback.onRequestContinued();
}).catch((err) => {
- console.log("getAuthenticatorCallback err: " + JSON.stringify(err));
+ console.log('getAuthenticatorCallback err: ' + JSON.stringify(err));
});
```
@@ -4940,22 +4938,22 @@ Obtains the remote object of an authenticator. This API cannot be overloaded.
class MyAuthenticator extends account_appAccount.Authenticator {
addAccountImplicitly(authType, callerBundleName, options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.LoginAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.LoginAbility',
});
}
authenticate(name, authType, callerBundleName, options, callback) {
var result = {[account_appAccount.Constants.KEY_NAME]: name,
[account_appAccount.Constants.KEY_AUTH_TYPE]: authType,
- [account_appAccount.Constants.KEY_TOKEN]: "xxxxxx"};
+ [account_appAccount.Constants.KEY_TOKEN]: 'xxxxxx'};
callback.onResult(account_appAccount.ResultCode.SUCCESS, result);
}
verifyCredential(name, options, callback) {
callback.onRequestRedirected({
- bundleName: "com.example.accountjsdemo",
- abilityName: "com.example.accountjsdemo.VerifyAbility",
+ bundleName: 'com.example.accountjsdemo',
+ abilityName: 'com.example.accountjsdemo.VerifyAbility',
parameters: {
name: name
}
diff --git a/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md b/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md
index f8bbe2212f0b6b9ae41183bfce2ae7c03a726d99..b6a2b41d6c9b9ed05603c68f94d8f53426570414 100644
--- a/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md
+++ b/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md
@@ -116,8 +116,8 @@ struct SnapshotExample {
Image(this.pixmap)
.width(300).height(300)
// ...Component
- // ...Components
- // ...Components
+ // ...Component
+ // ...Component
Button("click to generate UI snapshot")
.onClick(() => {
componentSnapshot.get("root")
diff --git a/en/application-dev/reference/apis/js-apis-avsession.md b/en/application-dev/reference/apis/js-apis-avsession.md
index d9a98b7c17e79f588e60b199f8bf4530e781ce83..d70b0712fa9df71eb1ca31a3a03970a714c03f91 100644
--- a/en/application-dev/reference/apis/js-apis-avsession.md
+++ b/en/application-dev/reference/apis/js-apis-avsession.md
@@ -4,14 +4,12 @@ The **avSession** module provides APIs for media playback control so that applic
This module provides the following typical features related to media sessions:
-- [AVSession](#avsession): used to set session metadata, playback state information, and more.
-- [AVSessionController](#avsessioncontroller): used to obtain session IDs, send commands and events to sessions, and obtain the session metadata and playback state information.
+- [AVSession](#avsession10): used to set session metadata, playback state information, and more.
+- [AVSessionController](#avsessioncontroller10): used to obtain session IDs, send commands and events to sessions, and obtain the session metadata and playback state information.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
->
-> All the APIs provided by this module are system APIs.
## Modules to Import
@@ -19,7 +17,7 @@ This module provides the following typical features related to media sessions:
import avSession from '@ohos.multimedia.avsession';
```
-## avSession.createAVSession
+## avSession.createAVSession10+
createAVSession(context: Context, tag: string, type: AVSessionType): Promise\
@@ -27,22 +25,19 @@ Creates a media session. This API uses a promise to return the result. An abilit
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------------- | ---- | ------------------------------ |
| context| [Context](js-apis-inner-app-context.md) | Yes| Application context, which provides application environment information.|
| tag | string | Yes | Custom session name. |
-| type | [AVSessionType](#avsessiontype) | Yes | Session type, which can be audio or video.|
-
+| type | [AVSessionType](#avsessiontype10) | Yes | Session type, which can be audio or video.|
**Return value**
| Type | Description |
| --------------------------------- | ------------------------------------------------------------ |
-| Promise<[AVSession](#avsession)\> | Promise used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.|
+| Promise<[AVSession](#avsession10)\> | Promise used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.|
**Error codes**
@@ -69,7 +64,7 @@ await avSession.createAVSession(context, tag, "audio").then((data) => {
});
```
-## avSession.createAVSession
+## avSession.createAVSession10+
createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback\): void
@@ -77,16 +72,14 @@ Creates a media session. This API uses an asynchronous callback to return the re
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| context| [Context](js-apis-inner-app-context.md) | Yes| Application context, which provides application environment information. |
| tag | string | Yes | Custom session name. |
-| type | [AVSessionType](#avsessiontype) | Yes | Session type, which can be audio or video. |
-| callback | AsyncCallback<[AVSession](#avsession)\> | Yes | Callback used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.|
+| type | [AVSessionType](#avsessiontype10) | Yes | Session type, which can be audio or video. |
+| callback | AsyncCallback<[AVSession](#avsession10)\> | Yes | Callback used to return the media session obtained, which can be used to obtain the session ID, set the metadata and playback state information, and send key events.|
**Error codes**
@@ -316,7 +309,7 @@ Creates a session controller based on the session ID. Multiple session controlle
| Type | Description |
| ----------------------------------------------------- | ------------------------------------------------------------ |
-| Promise<[AVSessionController](#avsessioncontroller)\> | Promise used to return the session controller created, which can be used to obtain the session ID, send commands and events to sessions, and obtain metadata and playback state information.|
+| Promise<[AVSessionController](#avsessioncontroller10)\> | Promise used to return the session controller created, which can be used to obtain the session ID, send commands and events to sessions, and obtain metadata and playback state information.|
**Error codes**
@@ -369,7 +362,7 @@ Creates a session controller based on the session ID. Multiple session controlle
| Name | Type | Mandatory| Description |
| --------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| sessionId | string | Yes | Session ID. |
-| callback | AsyncCallback<[AVSessionController](#avsessioncontroller)\> | Yes | Callback used to return the session controller created, which can be used to obtain the session ID, send commands and events to sessions, and obtain metadata and playback state information.|
+| callback | AsyncCallback<[AVSessionController](#avsessioncontroller10)\> | Yes | Callback used to return the session controller created, which can be used to obtain the session ID, send commands and events to sessions, and obtain metadata and playback state information.|
**Error codes**
@@ -777,7 +770,7 @@ Sends a system control command to the top session. This API uses a promise to re
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ----------------------------------- |
-| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send.|
+| command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send.|
**Return value**
@@ -837,7 +830,7 @@ Sends a system control command to the top session. This API uses an asynchronous
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ------------------------------------- |
-| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send. |
+| command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send. |
| callback | AsyncCallback\ | Yes | Callback used to return the result. If the command is sent, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
@@ -878,17 +871,14 @@ avSession.sendSystemControlCommand(avcommand, function (err) {
});
```
-## AVSession
+## AVSession10+
-An **AVSession** object is created by calling [avSession.createAVSession](#avsessioncreateavsession). The object enables you to obtain the session ID and set the metadata and playback state.
+An **AVSession** object is created by calling [avSession.createAVSession](#avsessioncreateavsession10). The object enables you to obtain the session ID and set the metadata and playback state.
### Attributes
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
-
| Name | Type | Readable| Writable| Description |
| :-------- | :----- | :--- | :--- | :---------------------------- |
| sessionId | string | Yes | No | Unique session ID of the **AVSession** object.|
@@ -899,7 +889,7 @@ An **AVSession** object is created by calling [avSession.createAVSession](#avses
let sessionId = session.sessionId;
```
-### setAVMetadata
+### setAVMetadata10+
setAVMetadata(data: AVMetadata): Promise\
@@ -907,13 +897,11 @@ Sets session metadata. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ------------ |
-| data | [AVMetadata](#avmetadata) | Yes | Session metadata.|
+| data | [AVMetadata](#avmetadata10) | Yes | Session metadata.|
**Return value**
@@ -956,7 +944,7 @@ session.setAVMetadata(metadata).then(() => {
});
```
-### setAVMetadata
+### setAVMetadata10+
setAVMetadata(data: AVMetadata, callback: AsyncCallback\): void
@@ -964,13 +952,11 @@ Sets session metadata. This API uses an asynchronous callback to return the resu
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------- |
-| data | [AVMetadata](#avmetadata) | Yes | Session metadata. |
+| data | [AVMetadata](#avmetadata10) | Yes | Session metadata. |
| callback | AsyncCallback\ | Yes | Callback used to return the result. If the setting is successful, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
@@ -1010,7 +996,7 @@ session.setAVMetadata(metadata, function (err) {
});
```
-### setAVPlaybackState
+### setAVPlaybackState10+
setAVPlaybackState(state: AVPlaybackState): Promise\
@@ -1018,13 +1004,11 @@ Sets information related to the session playback state. This API uses a promise
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ----------------------------------- | ---- | ---------------------------------------------- |
-| data | [AVPlaybackState](#avplaybackstate) | Yes | Information related to the session playback state.|
+| data | [AVPlaybackState](#avplaybackstate10) | Yes | Information related to the session playback state.|
**Return value**
@@ -1033,6 +1017,7 @@ Sets information related to the session playback state. This API uses a promise
| Promise\ | Promise used to return the result. If the setting is successful, no value is returned; otherwise, an error object is returned.|
**Error codes**
+
For details about the error codes, see [AVSession Management Error Codes](../errorcodes/errorcode-avsession.md).
| ID| Error Message|
@@ -1058,7 +1043,7 @@ session.setAVPlaybackState(playbackState).then(() => {
});
```
-### setAVPlaybackState
+### setAVPlaybackState10+
setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\): void
@@ -1066,13 +1051,11 @@ Sets information related to the session playback state. This API uses an asynchr
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------- | ---- | ---------------------------------------------- |
-| data | [AVPlaybackState](#avplaybackstate) | Yes | Information related to the session playback state.|
+| data | [AVPlaybackState](#avplaybackstate10) | Yes | Information related to the session playback state.|
| callback | AsyncCallback\ | Yes | Callback used to return the result. If the setting is successful, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
@@ -1112,8 +1095,6 @@ Sets a playlist. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1182,8 +1163,6 @@ Sets a playlist. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1249,8 +1228,6 @@ Sets a name for the playlist. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1291,8 +1268,6 @@ Sets a name for the playlist. This API uses an asynchronous callback to return t
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1322,7 +1297,7 @@ session.setAVQueueTitle(queueTitle, function (err) {
});
```
-### setLaunchAbility
+### setLaunchAbility10+
setLaunchAbility(ability: WantAgent): Promise\
@@ -1330,8 +1305,6 @@ Sets a launcher ability. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1395,7 +1368,7 @@ wantAgent.getWantAgent(wantAgentInfo).then((agent) => {
});
```
-### setLaunchAbility
+### setLaunchAbility10+
setLaunchAbility(ability: WantAgent, callback: AsyncCallback\): void
@@ -1403,8 +1376,6 @@ Sets a launcher ability. This API uses an asynchronous callback to return the re
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1473,8 +1444,6 @@ Dispatches a custom event in the session, including the event name and event con
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1521,8 +1490,6 @@ Dispatches a custom event in the session, including the event name and event con
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1566,8 +1533,6 @@ Sets a custom media packet in the form of key-value pairs. This API uses a promi
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1645,7 +1610,7 @@ await session.setExtras(extras, (err) => {
})
```
-### getController
+### getController10+
getController(): Promise\
@@ -1653,13 +1618,11 @@ Obtains the controller corresponding to this session. This API uses a promise to
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| ---------------------------------------------------- | ----------------------------- |
-| Promise<[AVSessionController](#avsessioncontroller)> | Promise used to return the session controller.|
+| Promise<[AVSessionController](#avsessioncontroller10)> | Promise used to return the session controller.|
**Error codes**
@@ -1682,7 +1645,7 @@ session.getController().then((avcontroller) => {
});
```
-### getController
+### getController10+
getController(callback: AsyncCallback\): void
@@ -1690,13 +1653,11 @@ Obtains the controller corresponding to this session. This API uses an asynchron
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | -------------------------- |
-| callback | AsyncCallback<[AVSessionController](#avsessioncontroller)\> | Yes | Callback used to return the session controller.|
+| callback | AsyncCallback<[AVSessionController](#avsessioncontroller10)\> | Yes | Callback used to return the session controller.|
**Error codes**
@@ -1721,7 +1682,7 @@ session.getController(function (err, avcontroller) {
});
```
-### getOutputDevice
+### getOutputDevice10+
getOutputDevice(): Promise\
@@ -1729,13 +1690,11 @@ Obtains information about the output device for this session. This API uses a pr
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| ---------------------------------------------- | --------------------------------- |
-| Promise<[OutputDeviceInfo](#outputdeviceinfo)> | Promise used to return the output device information.|
+| Promise<[OutputDeviceInfo](#outputdeviceinfo10)> | Promise used to return the output device information.|
**Error codes**
@@ -1756,7 +1715,7 @@ session.getOutputDevice().then((outputDeviceInfo) => {
});
```
-### getOutputDevice
+### getOutputDevice10+
getOutputDevice(callback: AsyncCallback\): void
@@ -1764,13 +1723,11 @@ Obtains information about the output device for this session. This API uses an a
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ------------------------------ |
-| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo)\> | Yes | Callback used to return the information obtained.|
+| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo10)\> | Yes | Callback used to return the information obtained.|
**Error codes**
@@ -1793,7 +1750,7 @@ session.getOutputDevice(function (err, outputDeviceInfo) {
});
```
-### activate
+### activate10+
activate(): Promise\
@@ -1801,8 +1758,6 @@ Activates this session. A session can be used only after being activated. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -1828,7 +1783,7 @@ session.activate().then(() => {
});
```
-### activate
+### activate10+
activate(callback: AsyncCallback\): void
@@ -1836,8 +1791,6 @@ Activates this session. A session can be used only after being activated. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1865,16 +1818,14 @@ session.activate(function (err) {
});
```
-### deactivate
+### deactivate10+
deactivate(): Promise\
-Deactivates this session. You can use [activate](#activate) to activate the session again. This API uses a promise to return the result.
+Deactivates this session. You can use [activate](#activate10) to activate the session again. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -1900,18 +1851,16 @@ session.deactivate().then(() => {
});
```
-### deactivate
+### deactivate10+
deactivate(callback: AsyncCallback\): void
Deactivates this session. This API uses an asynchronous callback to return the result.
-Deactivates this session. You can use [activate](#activate) to activate the session again.
+Deactivates this session. You can use [activate](#activate10) to activate the session again.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -1939,7 +1888,7 @@ session.deactivate(function (err) {
});
```
-### destroy
+### destroy10+
destroy(): Promise\
@@ -1947,8 +1896,6 @@ Destroys this session. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -1974,7 +1921,7 @@ session.destroy().then(() => {
});
```
-### destroy
+### destroy10+
destroy(callback: AsyncCallback\): void
@@ -1982,8 +1929,6 @@ Destroys this session. This API uses an asynchronous callback to return the resu
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2011,7 +1956,7 @@ session.destroy(function (err) {
});
```
-### on('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')
+### on('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')10+
on(type: 'play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind', callback: () => void): void
@@ -2019,8 +1964,6 @@ Subscribes to playback command events.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2063,7 +2006,7 @@ session.on('rewind', () => {
});
```
-### on('seek')
+### on('seek')10+
on(type: 'seek', callback: (time: number) => void): void
@@ -2071,8 +2014,6 @@ Subscribes to the seek event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2097,7 +2038,7 @@ session.on('seek', (time) => {
});
```
-### on('setSpeed')
+### on('setSpeed')10+
on(type: 'setSpeed', callback: (speed: number) => void): void
@@ -2105,8 +2046,6 @@ Subscribes to the event for setting the playback speed.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2131,7 +2070,7 @@ session.on('setSpeed', (speed) => {
});
```
-### on('setLoopMode')
+### on('setLoopMode')10+
on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void
@@ -2139,14 +2078,12 @@ Subscribes to the event for setting the loop mode.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ---- |
| type | string | Yes | Event type. The event **'setLoopMode'** is reported when the command for setting the loop mode is sent to the session.|
-| callback | (mode: [LoopMode](#loopmode)) => void | Yes | Callback used for subscription. The **mode** parameter in the callback indicates the loop mode. |
+| callback | (mode: [LoopMode](#loopmode10)) => void | Yes | Callback used for subscription. The **mode** parameter in the callback indicates the loop mode. |
**Error codes**
@@ -2165,7 +2102,7 @@ session.on('setLoopMode', (mode) => {
});
```
-### on('toggleFavorite')
+### on('toggleFavorite')10+
on(type: 'toggleFavorite', callback: (assetId: string) => void): void
@@ -2173,8 +2110,6 @@ Subscribes to the event for favoriting a media asset.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2207,8 +2142,6 @@ Subscribes to the event that indicates an item in the playlist is selected. The
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2233,7 +2166,7 @@ session.on('skipToQueueItem', (itemId) => {
});
```
-### on('handleKeyEvent')
+### on('handleKeyEvent')10+
on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void
@@ -2241,8 +2174,6 @@ Subscribes to the key event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2267,7 +2198,7 @@ session.on('handleKeyEvent', (event) => {
});
```
-### on('outputDeviceChange')
+### on('outputDeviceChange')10+
on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void
@@ -2275,14 +2206,12 @@ Subscribes to output device changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes.|
-| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. |
+| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. |
**Error codes**
@@ -2309,8 +2238,6 @@ Subscribes to custom control command changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2335,7 +2262,7 @@ session.on('commonCommand', (commonCommand, args) => {
});
```
-### off('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')
+### off('play'|'pause'|'stop'|'playNext'|'playPrevious'|'fastForward'|'rewind')10+
off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind', callback?: () => void): void
@@ -2343,8 +2270,6 @@ Unsubscribes from playback command events.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2373,7 +2298,7 @@ session.off('fastForward');
session.off('rewind');
```
-### off('seek')
+### off('seek')10+
off(type: 'seek', callback?: (time: number) => void): void
@@ -2381,8 +2306,6 @@ Unsubscribes from the seek event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2405,7 +2328,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('seek');
```
-### off('setSpeed')
+### off('setSpeed')10+
off(type: 'setSpeed', callback?: (speed: number) => void): void
@@ -2413,8 +2336,6 @@ Unsubscribes from the event for setting the playback speed.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2437,7 +2358,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('setSpeed');
```
-### off('setLoopMode')
+### off('setLoopMode')10+
off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void
@@ -2445,14 +2366,12 @@ Unsubscribes from the event for setting loop mode.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ----- |
| type | string | Yes | Event type. The value is fixed at **'setLoopMode'**.|
-| callback | (mode: [LoopMode](#loopmode)) => void | No | Callback used for unsubscription. The **mode** parameter in the callback indicates the loop mode. If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session.|
+| callback | (mode: [LoopMode](#loopmode10)) => void | No | Callback used for unsubscription. The **mode** parameter in the callback indicates the loop mode. If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session.|
**Error codes**
@@ -2469,7 +2388,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('setLoopMode');
```
-### off('toggleFavorite')
+### off('toggleFavorite')10+
off(type: 'toggleFavorite', callback?: (assetId: string) => void): void
@@ -2477,8 +2396,6 @@ Unsubscribes from the event for favoriting a media asset.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2509,8 +2426,6 @@ Unsubscribes from the event that indicates an item in the playlist is selected.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2533,7 +2448,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('skipToQueueItem');
```
-### off('handleKeyEvent')
+### off('handleKeyEvent')10+
off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void
@@ -2541,8 +2456,6 @@ Unsubscribes from the key event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2565,7 +2478,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
session.off('handleKeyEvent');
```
-### off('outputDeviceChange')
+### off('outputDeviceChange')10+
off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void
@@ -2573,14 +2486,12 @@ Unsubscribes from playback device changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'outputDeviceChange'**. |
-| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information. If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
+| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information. If the unsubscription is successful, **err** is **undefined**; otherwise, **err** is an error object. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes**
@@ -2606,8 +2517,6 @@ Unsubscribes from custom control command changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2631,7 +2540,7 @@ session.off('commonCommand');
-## AVSessionController
+## AVSessionController10+
An AV session controller is created by calling [avSession.createController](#avsessioncreatecontroller). Through the AV session controller, you can query the session ID, send commands and events to a session, and obtain session metadata and playback state information.
@@ -2639,9 +2548,6 @@ An AV session controller is created by calling [avSession.createController](#avs
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
-
| Name | Type | Readable| Writable| Description |
| :-------- | :----- | :--- | :--- | :-------------------------------------- |
| sessionId | string | Yes | No | Unique session ID of the **AVSessionController** object.|
@@ -2657,7 +2563,7 @@ await avSession.createController(session.sessionId).then((controller) => {
});
```
-### getAVPlaybackState
+### getAVPlaybackState10+
getAVPlaybackState(): Promise\
@@ -2665,13 +2571,11 @@ Obtains the information related to the playback state. This API uses a promise t
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| --------------------------------------------- | --------------------------- |
-| Promise<[AVPlaybackState](#avplaybackstate)\> | Promise used to return the **AVPlaybackState** object.|
+| Promise<[AVPlaybackState](#avplaybackstate10)\> | Promise used to return the **AVPlaybackState** object.|
**Error codes**
@@ -2692,7 +2596,7 @@ controller.getAVPlaybackState().then((playbackState) => {
});
```
-### getAVPlaybackState
+### getAVPlaybackState10+
getAVPlaybackState(callback: AsyncCallback\): void
@@ -2700,13 +2604,11 @@ Obtains the information related to the playback state. This API uses an asynchro
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---- | ---------------------------- |
-| callback | AsyncCallback<[AVPlaybackState](#avplaybackstate)\> | Yes | Callback used to return the **AVPlaybackState** object.|
+| callback | AsyncCallback<[AVPlaybackState](#avplaybackstate10)\> | Yes | Callback used to return the **AVPlaybackState** object.|
**Error codes**
@@ -2737,8 +2639,6 @@ Obtains the information related to the items in the queue. This API uses a promi
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -2772,8 +2672,6 @@ Obtains the information related to the items in the playlist. This API uses an a
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2809,8 +2707,6 @@ Obtains the name of the playlist. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -2844,8 +2740,6 @@ Obtains the name of the playlist. This API uses an asynchronous callback to retu
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2881,8 +2775,6 @@ Sends the ID of an item in the playlist to the session for processing. The sessi
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2923,8 +2815,6 @@ Sends the ID of an item in the playlist to the session for processing. The sessi
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -2954,7 +2844,7 @@ controller.skipToQueueItem(queueItemId, function (err) {
});
```
-### getAVMetadata
+### getAVMetadata10+
getAVMetadata(): Promise\
@@ -2962,13 +2852,11 @@ Obtains the session metadata. This API uses a promise to return the result.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| ----------------------------------- | ----------------------------- |
-| Promise<[AVMetadata](#avmetadata)\> | Promise used to return the metadata obtained.|
+| Promise<[AVMetadata](#avmetadata10)\> | Promise used to return the metadata obtained.|
**Error codes**
@@ -2989,7 +2877,7 @@ controller.getAVMetadata().then((metadata) => {
});
```
-### getAVMetadata
+### getAVMetadata10+
getAVMetadata(callback: AsyncCallback\): void
@@ -2997,13 +2885,11 @@ Obtains the session metadata. This API uses an asynchronous callback to return t
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------- | ---- | -------------------------- |
-| callback | AsyncCallback<[AVMetadata](#avmetadata)\> | Yes | Callback used to return the metadata obtained.|
+| callback | AsyncCallback<[AVMetadata](#avmetadata10)\> | Yes | Callback used to return the metadata obtained.|
**Error codes**
@@ -3026,7 +2912,7 @@ controller.getAVMetadata(function (err, metadata) {
});
```
-### getOutputDevice
+### getOutputDevice10+
getOutputDevice(): Promise\
@@ -3034,13 +2920,11 @@ Obtains the output device information. This API uses a promise to return the res
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| ----------------------------------------------- | --------------------------------- |
-| Promise<[OutputDeviceInfo](#outputdeviceinfo)\> | Promise used to return the information obtained.|
+| Promise<[OutputDeviceInfo](#outputdeviceinfo10)\> | Promise used to return the information obtained.|
**Error codes**
@@ -3060,7 +2944,7 @@ controller.getOutputDevice().then((deviceInfo) => {
});
```
-### getOutputDevice
+### getOutputDevice10+
getOutputDevice(callback: AsyncCallback\): void
@@ -3068,13 +2952,11 @@ Obtains the output device information. This API uses an asynchronous callback to
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ------------------------------ |
-| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo)\> | Yes | Callback used to return the information obtained.|
+| callback | AsyncCallback<[OutputDeviceInfo](#outputdeviceinfo10)\> | Yes | Callback used to return the information obtained.|
**Error codes**
@@ -3105,8 +2987,6 @@ Obtains the custom media packet set by the provider. This API uses a promise to
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -3138,8 +3018,6 @@ Obtains the custom media packet set by the provider. This API uses an asynchrono
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3183,7 +3061,7 @@ controller.getExtras(function (err, extras) {
});
```
-### sendAVKeyEvent
+### sendAVKeyEvent10+
sendAVKeyEvent(event: KeyEvent): Promise\
@@ -3191,8 +3069,6 @@ Sends a key event to the session corresponding to this controller. This API uses
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name| Type | Mandatory| Description |
@@ -3230,7 +3106,7 @@ controller.sendAVKeyEvent(event).then(() => {
});
```
-### sendAVKeyEvent
+### sendAVKeyEvent10+
sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\): void
@@ -3238,8 +3114,6 @@ Sends a key event to the session corresponding to this controller. This API uses
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3274,7 +3148,7 @@ controller.sendAVKeyEvent(event, function (err) {
});
```
-### getLaunchAbility
+### getLaunchAbility10+
getLaunchAbility(): Promise\
@@ -3282,13 +3156,11 @@ Obtains the **WantAgent** object saved by the application in the session. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| ------------------------------------------------------- | ------------------------------------------------------------ |
-| Promise<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Promise used to return the object saved by calling [setLaunchAbility](#setlaunchability). The object includes the application attribute, such as the bundle name, ability name, and device ID.|
+| Promise<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Promise used to return the object saved by calling [setLaunchAbility](#setlaunchability10). The object includes the application attribute, such as the bundle name, ability name, and device ID.|
**Error codes**
@@ -3312,7 +3184,7 @@ controller.getLaunchAbility().then((agent) => {
});
```
-### getLaunchAbility
+### getLaunchAbility10+
getLaunchAbility(callback: AsyncCallback\): void
@@ -3320,13 +3192,11 @@ Obtains the **WantAgent** object saved by the application in the session. This A
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
-| callback | AsyncCallback<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Yes | Callback used to return the object saved by calling [setLaunchAbility](#setlaunchability). The object includes the application attribute, such as the bundle name, ability name, and device ID.|
+| callback | AsyncCallback<[WantAgent](js-apis-app-ability-wantAgent.md)\> | Yes | Callback used to return the object saved by calling [setLaunchAbility](#setlaunchability10). The object includes the application attribute, such as the bundle name, ability name, and device ID.|
**Error codes**
@@ -3352,7 +3222,7 @@ controller.getLaunchAbility(function (err, agent) {
});
```
-### getRealPlaybackPositionSync
+### getRealPlaybackPositionSync10+
getRealPlaybackPositionSync(): number
@@ -3360,8 +3230,6 @@ Obtains the playback position.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -3383,7 +3251,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
let time = controller.getRealPlaybackPositionSync();
```
-### isActive
+### isActive10+
isActive(): Promise\
@@ -3391,8 +3259,6 @@ Checks whether the session is activated. This API uses a promise to return the r
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -3419,7 +3285,7 @@ controller.isActive().then((isActive) => {
});
```
-### isActive
+### isActive10+
isActive(callback: AsyncCallback\): void
@@ -3427,8 +3293,6 @@ Checks whether the session is activated. This API uses an asynchronous callback
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3457,7 +3321,7 @@ controller.isActive(function (err, isActive) {
});
```
-### destroy
+### destroy10+
destroy(): Promise\
@@ -3465,8 +3329,6 @@ Destroys this controller. A controller can no longer be used after being destroy
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
@@ -3492,7 +3354,7 @@ controller.destroy().then(() => {
});
```
-### destroy
+### destroy10+
destroy(callback: AsyncCallback\): void
@@ -3500,8 +3362,6 @@ Destroys this controller. A controller can no longer be used after being destroy
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3529,7 +3389,7 @@ controller.destroy(function (err) {
});
```
-### getValidCommands
+### getValidCommands10+
getValidCommands(): Promise\>
@@ -3537,13 +3397,11 @@ Obtains valid commands supported by the session. This API uses a promise to retu
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Return value**
| Type | Description |
| ------------------------------------------------------------ | --------------------------------- |
-| Promise\> | Promise used to return a set of valid commands.|
+| Promise\> | Promise used to return a set of valid commands.|
**Error codes**
@@ -3565,7 +3423,7 @@ controller.getValidCommands.then((validCommands) => {
});
```
-### getValidCommands
+### getValidCommands10+
getValidCommands(callback: AsyncCallback\>): void
@@ -3573,13 +3431,11 @@ Obtains valid commands supported by the session. This API uses an asynchronous c
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------ |
-| callback | AsyncCallback\\> | Yes | Callback used to return a set of valid commands.|
+| callback | AsyncCallback\\> | Yes | Callback used to return a set of valid commands.|
**Error codes**
@@ -3603,7 +3459,7 @@ controller.getValidCommands(function (err, validCommands) {
});
```
-### sendControlCommand
+### sendControlCommand10+
sendControlCommand(command: AVControlCommand): Promise\
@@ -3611,17 +3467,15 @@ Sends a control command to the session through the controller. This API uses a p
> **NOTE**
>
-> Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind).
+> Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind10).
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------- | ---- | ------------------------------ |
-| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send.|
+| command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send.|
**Return value**
@@ -3663,7 +3517,7 @@ controller.sendControlCommand(avCommand).then(() => {
});
```
-### sendControlCommand
+### sendControlCommand10+
sendControlCommand(command: AVControlCommand, callback: AsyncCallback\): void
@@ -3671,17 +3525,15 @@ Sends a control command to the session through the controller. This API uses an
> **NOTE**
>
-> Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind).
+> Before using **sendControlCommand**, the controller must ensure that the AVSession has registered with the corresponding listener. For details about how to register the listener, see [Registering AVSession Listeners](#onplaypausestopplaynextplaypreviousfastforwardrewind10).
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | ------------------------------ |
-| command | [AVControlCommand](#avcontrolcommand) | Yes | Command to send.|
+| command | [AVControlCommand](#avcontrolcommand10) | Yes | Command to send.|
| callback | AsyncCallback\ | Yes | Callback used to return the result. If the command is sent, **err** is **undefined**; otherwise, **err** is an error object. |
**Error codes**
@@ -3728,8 +3580,6 @@ Sends a custom control command to the session through the controller. This API u
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3780,8 +3630,6 @@ Sends a custom control command to the session through the controller. This API u
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3795,6 +3643,7 @@ Sends a custom control command to the session through the controller. This API u
> The **args** parameter supports the following data types: string, number, Boolean, object, array, and file descriptor. For details, see [@ohos.app.ability.Want(Want)](./js-apis-app-ability-want.md).
**Error codes**
+
For details about the error codes, see [AVSession Management Error Codes](../errorcodes/errorcode-avsession.md).
| ID| Error Message|
@@ -3820,7 +3669,7 @@ controller.sendCommonCommand(commandName, args, (err) => {
})
```
-### on('metadataChange')
+### on('metadataChange')10+
on(type: 'metadataChange', filter: Array\ | 'all', callback: (data: AVMetadata) => void)
@@ -3828,15 +3677,13 @@ Subscribes to the metadata change event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'metadataChange'** is reported when the session metadata changes.|
-| filter | Array\ | 'all' | Yes | The value **'all'** indicates that any metadata field change will trigger the event, and **Array** indicates that only changes to the listed metadata field will trigger the event.|
-| callback | (data: [AVMetadata](#avmetadata)) => void | Yes | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata. |
+| filter | Array\ | 'all' | Yes | The value **'all'** indicates that any metadata field change will trigger the event, and **Array** indicates that only changes to the listed metadata field will trigger the event.|
+| callback | (data: [AVMetadata](#avmetadata10)) => void | Yes | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata. |
**Error codes**
@@ -3860,7 +3707,7 @@ controller.on('metadataChange', metaFilter, (metadata) => {
});
```
-### on('playbackStateChange')
+### on('playbackStateChange')10+
on(type: 'playbackStateChange', filter: Array\ | 'all', callback: (state: AVPlaybackState) => void)
@@ -3868,15 +3715,13 @@ Subscribes to the playback state change event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'playbackStateChange'** is reported when the playback state changes.|
-| filter | Array\ | 'all' | Yes | The value **'all'** indicates that any playback state field change will trigger the event, and **Array** indicates that only changes to the listed playback state field will trigger the event.|
-| callback | (state: [AVPlaybackState](#avplaybackstate)) => void | Yes | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state. |
+| filter | Array\ | 'all' | Yes | The value **'all'** indicates that any playback state field change will trigger the event, and **Array** indicates that only changes to the listed playback state field will trigger the event.|
+| callback | (state: [AVPlaybackState](#avplaybackstate10)) => void | Yes | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state. |
**Error codes**
@@ -3908,8 +3753,6 @@ Subscribes to session event changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3942,8 +3785,6 @@ Subscribes to playlist item changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -3976,8 +3817,6 @@ Subscribes to playlist name changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4010,8 +3849,6 @@ Subscribes to custom media packet changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4037,7 +3874,7 @@ controller.on('extrasChange', (extras) => {
});
```
-### on('sessionDestroy')
+### on('sessionDestroy')10+
on(type: 'sessionDestroy', callback: () => void)
@@ -4045,8 +3882,6 @@ Subscribes to the session destruction event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4071,7 +3906,7 @@ controller.on('sessionDestroy', () => {
});
```
-### on('activeStateChange')
+### on('activeStateChange')10+
on(type: 'activeStateChange', callback: (isActive: boolean) => void)
@@ -4079,8 +3914,6 @@ Subscribes to the session activation state change event.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4105,7 +3938,7 @@ controller.on('activeStateChange', (isActive) => {
});
```
-### on('validCommandChange')
+### on('validCommandChange')10+
on(type: 'validCommandChange', callback: (commands: Array\) => void)
@@ -4113,14 +3946,12 @@ Subscribes to valid command changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'validCommandChange'** is reported when the valid commands supported by the session changes.|
-| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype)\>) => void | Yes | Callback used for subscription. The **commands** parameter in the callback is a set of valid commands. |
+| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype10)\>) => void | Yes | Callback used for subscription. The **commands** parameter in the callback is a set of valid commands. |
**Error codes**
@@ -4140,7 +3971,7 @@ controller.on('validCommandChange', (validCommands) => {
});
```
-### on('outputDeviceChange')
+### on('outputDeviceChange')10+
on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void
@@ -4148,14 +3979,12 @@ Subscribes to output device changes.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes.|
-| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. |
+| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | Yes | Callback used for subscription. The **device** parameter in the callback indicates the output device information. |
**Error codes**
@@ -4174,7 +4003,7 @@ controller.on('outputDeviceChange', (device) => {
});
```
-### off('metadataChange')
+### off('metadataChange')10+
off(type: 'metadataChange', callback?: (data: AVMetadata) => void)
@@ -4182,14 +4011,12 @@ Unsubscribes from metadata changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------ | ---- | ------------------------------------------------------ |
| type | string | Yes | Event type. The event **'metadataChange'** is reported when the session metadata changes. |
-| callback | (data: [AVMetadata](#avmetadata)) => void | No | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
+| callback | (data: [AVMetadata](#avmetadata10)) => void | No | Callback used for subscription. The **data** parameter in the callback indicates the changed metadata. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes**
@@ -4205,7 +4032,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('metadataChange');
```
-### off('playbackStateChange')
+### off('playbackStateChange')10+
off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void)
@@ -4213,14 +4040,12 @@ Unsubscribes from playback state changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- |
| type | string | Yes | Event type. The event **'playbackStateChange'** is reported when the playback state changes. |
-| callback | (state: [AVPlaybackState](#avplaybackstate)) => void | No | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
+| callback | (state: [AVPlaybackState](#avplaybackstate10)) => void | No | Callback used for subscription. The **state** parameter in the callback indicates the changed playback state. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes**
@@ -4244,8 +4069,6 @@ Unsubscribes from session event changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4275,8 +4098,6 @@ Unsubscribes from playback item changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4306,8 +4127,6 @@ Unsubscribes from playlist name changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4337,8 +4156,6 @@ Unsubscribes from custom media packet changes. This API is called by the control
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4362,7 +4179,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('extrasChange');
```
-### off('sessionDestroy')
+### off('sessionDestroy')10+
off(type: 'sessionDestroy', callback?: () => void)
@@ -4370,8 +4187,6 @@ Unsubscribes from the session destruction event. This API is called by the contr
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4393,7 +4208,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('sessionDestroy');
```
-### off('activeStateChange')
+### off('activeStateChange')10+
off(type: 'activeStateChange', callback?: (isActive: boolean) => void)
@@ -4401,8 +4216,6 @@ Unsubscribes from session activation state changes. This API is called by the co
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
@@ -4424,7 +4237,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('activeStateChange');
```
-### off('validCommandChange')
+### off('validCommandChange')10+
off(type: 'validCommandChange', callback?: (commands: Array\) => void)
@@ -4432,14 +4245,12 @@ Unsubscribes from valid command changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | -------------------------------------------------------- |
| type | string | Yes | Event type. The event **'validCommandChange'** is reported when the supported commands change. |
-| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype)\>) => void | No | Callback used for unsubscription. The **commands** parameter in the callback is a set of valid commands. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
+| callback | (commands: Array<[AVControlCommandType](#avcontrolcommandtype10)\>) => void | No | Callback used for unsubscription. The **commands** parameter in the callback is a set of valid commands. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes**
@@ -4455,7 +4266,7 @@ For details about the error codes, see [AVSession Management Error Codes](../err
controller.off('validCommandChange');
```
-### off('outputDeviceChange')
+### off('outputDeviceChange')10+
off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void
@@ -4463,14 +4274,12 @@ Unsubscribes from output device changes. This API is called by the controller.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------- | ---- | ------------------------------------------------------ |
| type | string | Yes | Event type. The event **'outputDeviceChange'** is reported when the output device changes. |
-| callback | (device: [OutputDeviceInfo](#outputdeviceinfo)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
+| callback | (device: [OutputDeviceInfo](#outputdeviceinfo10)) => void | No | Callback used for unsubscription. The **device** parameter in the callback indicates the output device information. The **callback** parameter is optional. If it is not specified, all the subscriptions to the specified event are canceled for this session. |
**Error codes**
@@ -4502,13 +4311,11 @@ Describes the information about a session token.
| pid | number | Yes | Process ID of the session.|
| uid | number | Yes | User ID. |
-## AVSessionType
+## AVSessionType10+
Enumerates the session types supported by the session.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Description|
| ----- | ------ | ---- |
| audio | string | Audio session.|
@@ -4525,21 +4332,19 @@ Declares the session descriptor.
| Name | Type | Readable| Writable| Description |
| ------------ | ------------------------------------------------------------ | ---- | --------------------------------------------------- | --------------------------------------------------- |
| sessionId | string | Yes | No| Session ID. |
-| type | [AVSessionType](#avsessiontype) | Yes | No | Session type. |
+| type | [AVSessionType](#avsessiontype10) | Yes | No | Session type. |
| sessionTag | string | Yes | No | Custom session name. |
| elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes | No | Information about the application to which the session belongs, including the bundle name and ability name.|
| isActive | boolean | Yes | No | Whether the session is activated. |
| isTopSession | boolean | Yes | No | Whether the session is the top session. |
-| outputDevice | [OutputDeviceInfo](#outputdeviceinfo) | Yes | No | Information about the output device. |
+| outputDevice | [OutputDeviceInfo](#outputdeviceinfo10) | Yes | No | Information about the output device. |
-## AVControlCommandType
+## AVControlCommandType10+
Enumerates the commands that can be sent to a session.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Description |
| -------------- | ------ | ------------ |
| play | string | Play the media. |
@@ -4554,27 +4359,23 @@ Enumerates the commands that can be sent to a session.
| setLoopMode | string | Set the loop mode.|
| toggleFavorite | string | Favorite the media asset. |
-## AVControlCommand
+## AVControlCommand10+
Describes the command that can be sent to the session.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Mandatory| Description |
| --------- | ------------------------------------------------- | ---- | -------------- |
-| command | [AVControlCommandType](#avcontrolcommandtype) | Yes | Command. |
-| parameter | [LoopMode](#loopmode) | string | number | No | Parameters carried in the command.|
+| command | [AVControlCommandType](#avcontrolcommandtype10) | Yes | Command. |
+| parameter | [LoopMode](#loopmode10) | string | number | No | Parameters carried in the command.|
-## AVMetadata
+## AVMetadata10+
Describes the media metadata.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Mandatory| Description |
| --------------- |-------------------------| ---- |---------------------------------------------------------------------|
| assetId | string | Yes | Media ID. |
@@ -4621,60 +4422,52 @@ Describes the attributes of an item in the playlist.
| itemId | number | Yes | ID of an item in the playlist. |
| description | [AVMediaDescription](#avmediadescription10) | Yes | Media metadata of the item in the playlist. |
-## AVPlaybackState
+## AVPlaybackState10+
Describes the information related to the media playback state.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Mandatory| Description |
| ------------ | ------------------------------------- | ---- | ------- |
| state | [PlaybackState](#playbackstate) | No | Playback state.|
| speed | number | No | Playback speed.|
| position | [PlaybackPosition](#playbackposition) | No | Playback position.|
| bufferedTime | number | No | Buffered time.|
-| loopMode | [LoopMode](#loopmode) | No | Loop mode.|
+| loopMode | [LoopMode](#loopmode10) | No | Loop mode.|
| isFavorite | boolean | No | Whether the media asset is favorited.|
| activeItemId10+ | number | No | ID of the item that is being played.|
| extras10+ | {[key: string]: Object} | No | Custom media data.|
-## PlaybackPosition
+## PlaybackPosition10+
Describes the information related to the playback position.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------ |
| elapsedTime | number | Yes | Elapsed time, in ms.|
| updateTime | number | Yes | Updated time, in ms.|
-## OutputDeviceInfo
+## OutputDeviceInfo10+
Describes the information related to the output device.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Type | Mandatory| Description |
| ---------- | -------------- | ---- | ---------------------- |
| isRemote | boolean | Yes | Whether the device is connected. |
| audioDeviceId | Array | Yes | IDs of output devices. |
| deviceName | Array | Yes | Names of output devices. |
-## PlaybackState
+## PlaybackState10+
Enumerates the media playback states.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Value | Description |
| --------------------------- | ---- | ----------- |
| PLAYBACK_STATE_INITIAL | 0 | Initial. |
@@ -4686,14 +4479,12 @@ Enumerates the media playback states.
| PLAYBACK_STATE_STOP | 6 | Stopped. |
-## LoopMode
+## LoopMode10+
Enumerates the loop modes of media playback.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Value | Description |
| ------------------ | ---- | -------- |
| LOOP_MODE_SEQUENCE | 0 | Sequential playback.|
@@ -4701,14 +4492,12 @@ Enumerates the loop modes of media playback.
| LOOP_MODE_LIST | 2 | Playlist loop.|
| LOOP_MODE_SHUFFLE | 3 | Shuffle.|
-## AVSessionErrorCode
+## AVSessionErrorCode10+
Enumerates the error codes used in the media session.
**System capability**: SystemCapability.Multimedia.AVSession.Core
-**System API**: This is a system API.
-
| Name | Value | Description |
| ------------------------------ | ------- | ------------------------------- |
| ERR_CODE_SERVICE_EXCEPTION | 6600101 | Session service exception. |
@@ -4719,4 +4508,4 @@ Enumerates the error codes used in the media session.
| ERR_CODE_SESSION_INACTIVE | 6600106 | The session is not activated. |
| ERR_CODE_MESSAGE_OVERLOAD | 6600107 | Too many commands or events. |
-
\ No newline at end of file
+
diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md
index ac9aa9841ec9efd561198dd56f98a10f7331de1e..ec3b9fa9e3b5fb8ef8107276e889c62e4bc2c278 100644
--- a/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md
+++ b/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md
@@ -9,7 +9,6 @@ The **ApplicationInfo** module defines the application information. A system app
## ApplicationInfo
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
-
| Name | Type | Readable| Writable| Description |
| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
| name | string | Yes | No | Application name. |
@@ -27,9 +26,9 @@ The **ApplicationInfo** module defines the application information. A system app
| removable | boolean | Yes | No | Whether the application is removable. |
| accessTokenId | number | Yes | No | Access token ID of the application. |
| uid | number | Yes | No | UID of the application. |
-| iconResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details. |
-| labelResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details. |
-| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details.|
+| iconResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details. |
+| labelResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details. |
+| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details.|
| appDistributionType | string | Yes | No | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**. |
| appProvisionType | string | Yes | No | Type of the application signing certificate file. The options are **debug** and **release**. |
| systemApp | boolean | Yes | No | Whether the application is a system application. |
diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md
index b8d4e4b54a0d34826962b8d3d66b5e7f1b30be13..c86b21c5f8c541e29b38eeb38cb25edfc13bfc14 100644
--- a/en/application-dev/reference/apis/js-apis-camera.md
+++ b/en/application-dev/reference/apis/js-apis-camera.md
@@ -2,8 +2,7 @@
> **NOTE**
>
-> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
-> - The APIs provided by this module are system APIs.
+> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
@@ -110,17 +109,18 @@ Enumerates the camera error codes, which are returned when an API call is incorr
**System capability**: SystemCapability.Multimedia.Camera.Core
-| Name | Value | Description |
-| ------------------------- | ---- | ------------ |
-| INVALID_ARGUMENT | 7400101 | A parameter is missing or the parameter type is incorrect. |
-| OPERATION_NOT_ALLOWED | 7400102 | The operation is not allowed. |
-| SESSION_NOT_CONFIG | 7400103 | The session is not configured. |
-| SESSION_NOT_RUNNING | 7400104 | The session is not running. |
-| SESSION_CONFIG_LOCKED | 7400105 | The session configuration is locked. |
-| DEVICE_SETTING_LOCKED | 7400106 | The device setting is locked. |
-| CONFILICT_CAMERA | 7400107 | The device is already started. |
-| DEVICE_DISABLED | 7400108 | The camera is disabled for security reasons. |
-| SERVICE_FATAL_ERROR | 7400201 | An error occurs in the camera service. |
+| Name | Value | Description |
+| ------------------------- | ---- | ------------ |
+| INVALID_ARGUMENT | 7400101 | A parameter is missing or the parameter type is incorrect. |
+| OPERATION_NOT_ALLOWED | 7400102 | The operation is not allowed. |
+| SESSION_NOT_CONFIG | 7400103 | The session is not configured. |
+| SESSION_NOT_RUNNING | 7400104 | The session is not running. |
+| SESSION_CONFIG_LOCKED | 7400105 | The session configuration is locked. |
+| DEVICE_SETTING_LOCKED | 7400106 | The device setting is locked. |
+| CONFLICT_CAMERA | 7400107 | The device is already started. |
+| DEVICE_DISABLED | 7400108 | The camera is disabled for security reasons. |
+| DEVICE_PREEMPTED | 7400109 | The camera is preempted. |
+| SERVICE_FATAL_ERROR | 7400201 | An error occurs in the camera service. |
## CameraManager
@@ -203,7 +203,7 @@ isCameraMuteSupported(): boolean
Checks whether the camera can be muted.
-This is a system API.
+**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core
@@ -225,7 +225,7 @@ muteCamera(mute: boolean): void
Mutes or unmutes the camera.
-This is a system API.
+**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core
@@ -562,7 +562,7 @@ on(type: 'cameraMute', callback: AsyncCallback\): void
Listens for camera mute status changes. This API uses an asynchronous callback to return the result.
-This is a system API.
+**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.Camera.Core
@@ -630,6 +630,20 @@ Enumerates the camera connection types.
| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB.|
| CAMERA_CONNECTION_REMOTE | 2 | Remote camera.|
+## HostDeviceType
+
+Enumerates the remote camera types.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Multimedia.Camera.Core
+
+| Name | Value | Description |
+| ---------------------------- | ---- | ------------- |
+| UNKNOWN_TYPE | 0 | Unknown type. |
+| PHONE | 0x0E | Camera of a smartphone.|
+| TABLET | 0x11 | Camera of a tablet.|
+
## CameraDevice
Defines the camera device information.
@@ -642,6 +656,8 @@ Defines the camera device information.
| cameraPosition | [CameraPosition](#cameraposition) | Yes | Camera position. |
| cameraType | [CameraType](#cameratype) | Yes | Camera type. |
| connectionType | [ConnectionType](#connectiontype) | Yes | Camera connection type.|
+| hostDeviceName | string | Yes | Name of the remote device. **System API**: This is a system API.|
+| hostDeviceType | [hostDeviceType](#hostdevicetype) | Yes | Type of the remote device. **System API**: This is a system API.|
## Size
@@ -1754,7 +1770,7 @@ Before the setting, you are advised to use **[getExposureBiasRange](#getexposure
| Name | Type | Mandatory| Description |
| -------- | -------------------------------| ---- | ------------------- |
-| exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If calling the API fails, an error code defined in [CameraErrorCode](#cameraerrorcode) will be returned. If the value passed is not within the supported range, the nearest critical point is used.|
+| exposureBias | number | Yes | EV. The supported EV range can be obtained by calling **getExposureBiasRange**. If the value passed is not within the supported range, the nearest critical point is used. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned. |
**Error codes**
@@ -1788,7 +1804,7 @@ Obtains the exposure value in use.
| Type | Description |
| ---------- | ----------------------------- |
-| number | Exposure value obtained. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned.|
+| number | Exposure value obtained. There is a step for EV. For example, if the step is 0.5 and this parameter is set to 1.2, the EV that takes effect is 1.0. If the operation fails, an error code defined in [CameraErrorCode](#cameraerrorcode) is returned. |
**Error codes**
diff --git a/en/application-dev/reference/apis/js-apis-data-cloudData.md b/en/application-dev/reference/apis/js-apis-data-cloudData.md
new file mode 100644
index 0000000000000000000000000000000000000000..38c6d65e42ea6c2665f33812d94b7093432af401
--- /dev/null
+++ b/en/application-dev/reference/apis/js-apis-data-cloudData.md
@@ -0,0 +1,348 @@
+# @ohos.data.cloudData (Device-Cloud Synergy)
+
+The **cloudData** module provides the capability of synchronizing the structured data (in RDB stores) between the device and cloud. The cloud serves as the central node of data. The devices synchronize data with the data in the cloud to implement cloud data backup and data consistency between the devices with the same account.
+
+This module provides the following common functions:
+
+- [Config](#config): provides methods for configuring device-cloud synergy, including enabling and disabling cloud synchronization, clearing data, and notifying data changes.
+
+> **NOTE**
+>
+> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
+
+## Modules to Import
+
+```js
+import cloudData from '@ohos.data.cloudData';
+```
+
+## Action
+
+Enumerates the actions for clearing the cloud information about the local data.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+| Name | Description |
+| --------- | ---------------------------- |
+| CLEAR_CLOUD_INFO | Clear the cloud ID information.|
+| CLEAR_CLOUD_DATA_AND_INFO |Clear all cloud data, including cloud ID information and data downloaded from the cloud (excluding the data modified or generated locally). |
+
+## Config
+
+Provides methods for configuring device-cloud synergy, including enabling and disabling cloud synchronization, clearing data, and notifying data changes.
+
+### enableCloud
+
+static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}, callback: AsyncCallback<void>):void
+
+Enables device-cloud synergy. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
+| accountId | string | Yes | ID of the target cloud. |
+| switches | {[bundleName: string]: boolean} | Yes | Device-cloud synergy switches for applications. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
+try {
+ cloudData.Config.enableCloud(account, switches, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in enabling cloud');
+ } else {
+ console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### enableCloud
+
+static enableCloud(accountId: string, switches: {[bundleName: string]: boolean}): Promise<void>
+
+Enables device-cloud synergy. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
+| accountId | string | Yes | ID of the target cloud. |
+| switches | {[bundleName: string]: boolean} | Yes | Device-cloud synergy switches for applications. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+let switches = { 'test_bundleName1': true, 'test_bundleName2': false };
+try {
+ cloudData.Config.enableCloud(account, switches).then(() => {
+ console.info('Succeeded in enabling cloud');
+ }).catch((err) => {
+ console.error(`Failed to enable.Code: ${err.code}, message: ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### disableCloud
+
+static disableCloud(accountId: string, callback: AsyncCallback<void>):void
+
+Disables device-cloud synergy. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------- | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+try {
+ cloudData.Config.disableCloud(account, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in disabling cloud');
+ } else {
+ console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### disableCloud
+
+static disableCloud(accountId: string): Promise<void>
+
+Disables device-cloud synergy. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------ | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+try {
+ cloudData.Config.disableCloud(account).then(() => {
+ console.info('Succeeded in disabling cloud');
+ }).catch((err) => {
+ console.error(`Failed to disableCloud. Code: ${err.code}, message: ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### changeAppCloudSwitch
+
+static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean, callback: AsyncCallback<void>):void
+
+Changes the device-cloud synergy switch for an application. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ---------------------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName| string | Yes | Name of the target application.|
+| status | boolean | Yes | Setting of the device-cloud synergy switch for the application. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.changeAppCloudSwitch(account, bundleName, true, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in changing App cloud switch');
+ } else {
+ console.error(`Failed to change App cloud switch. Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### changeAppCloudSwitch
+
+static changeAppCloudSwitch(accountId: string,bundleName:string,status:boolean): Promise<void>
+
+Changes the device-cloud synergy switch for an application. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Config
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| --------- | ------------------------------- | ---- | ---------------------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName| string | Yes | Name of the target application.|
+| status | boolean | Yes | Setting of the device-cloud synergy switch for the application. The value **true** means to enable the device-cloud synergy; the value **false** means the opposite.|
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.changeAppCloudSwitch(account, bundleName, true).then(() => {
+ console.info('Succeeded in changing App cloud switch');
+ }).catch((err) => {
+ console.error(`Failed to change App cloud switch. Code is ${err.code}, message is ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### notifyDataChange
+
+static notifyDataChange(accountId: string,bundleName:string, callback: AsyncCallback<void>):void
+
+Notifies the data changes in the cloud. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Server
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------------------------- | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName | string | Yes | Name of the target application. |
+| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.notifyDataChange(account, bundleName, function (err) {
+ if (err === undefined) {
+ console.info('Succeeded in notifying the change of data');
+ } else {
+ console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
+ }
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
+
+### notifyDataChange
+
+static notifyDataChange(accountId: string,bundleName:string): Promise<void>
+
+Notifies the data changes in the cloud. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**Required permissions**: ohos.permission.CLOUDDATA_CONFIG
+
+**System capability**: SystemCapability.DistributedDataManager.CloudSync.Server
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| ---------- | ------ | ---- | ---------------- |
+| accountId | string | Yes | ID of the target cloud.|
+| bundleName | string | Yes | Name of the target application. |
+
+**Return value**
+
+| Type | Description |
+| ------------------- | ------------------------- |
+| Promise<void> | Promise that returns no value.|
+
+**Example**
+
+```js
+let account = 'test_id';
+let bundleName = 'test_bundleName';
+try {
+ cloudData.Config.notifyDataChange(account, bundleName).then(() => {
+ console.info('Succeeded in notifying the change of data');
+ }).catch((err) => {
+ console.error(`Failed to notify the change of data. Code: ${err.code}, message: ${err.message}`);
+ });
+} catch (error) {
+ console.error(`An unexpected error occurred. Code: ${error.code}, message: ${error.message}`);
+}
+```
diff --git a/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md b/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md
index 78d896c54a2f1c1674825ddaff66088634129596..6f63bb98574f0499ea47acb1f9ff0e04fff65f34 100644
--- a/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md
+++ b/en/application-dev/reference/apis/js-apis-data-dataSharePredicates.md
@@ -1,4 +1,4 @@
-# @ohos.data.dataSharePredicates (DataShare Predicates)
+# @ohos.data.dataSharePredicates (Data Share Predicates)
You can use **DataSharePredicates** to specify conditions for [updating](js-apis-data-dataShare.md#update), [deleting](js-apis-data-dataShare.md#delete), and [querying](js-apis-data-dataShare.md#query) data when **DataShare** is used to manage data.
@@ -18,13 +18,13 @@ import dataSharePredicates from '@ohos.data.dataSharePredicates';
```
## DataSharePredicates
-Provides methods for setting different **DataSharePredicates** objects.
+Provides methods for setting different **DataSharePredicates** objects. This type is not multi-thread safe. If a **DataSharePredicates** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
### equalTo
equalTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is equal to the specified value.
Currently, only the relational database (RDB) and key-value database (KVDB, schema) support this **DataSharePredicates** object.
@@ -54,10 +54,11 @@ predicates.equalTo("NAME", "Rose")
notEqualTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is not equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is not equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -88,6 +89,7 @@ Adds a left parenthesis to this **DataSharePredicates**.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -116,6 +118,7 @@ Adds a right parenthesis to this **DataSharePredicates** object.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -144,6 +147,7 @@ Adds the OR condition to this **DataSharePredicates** object.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -190,10 +194,11 @@ predicates.equalTo("NAME", "lisi")
contains(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that contains the specified value.
+Sets a **DataSharePredicates** object to match the data that contains the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -220,10 +225,11 @@ predicates.contains("NAME", "os")
beginsWith(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that begins with the specified value.
+Sets a **DataSharePredicates** object to match the data that begins with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -250,10 +256,11 @@ predicates.beginsWith("NAME", "os")
endsWith(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that ends with the specified value.
+Sets a **DataSharePredicates** object to match the data that ends with the specified value.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -280,10 +287,11 @@ predicates.endsWith("NAME", "os")
isNull(field: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data whose value is null.
+Sets a **DataSharePredicates** object to match the data whose value is null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -309,10 +317,11 @@ predicates.isNull("NAME")
isNotNull(field: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data whose value is not null.
+Sets a **DataSharePredicates** object to match the data whose value is not null.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -338,10 +347,11 @@ predicates.isNotNull("NAME")
like(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that matches the specified wildcard expression.
+Sets a **DataSharePredicates** object to match the data that matches the specified wildcard expression.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -368,10 +378,11 @@ predicates.like("NAME", "%os%")
unlike(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that does not match the specified wildcard expression.
+Sets a **DataSharePredicates** object to match the data that does not match the specified wildcard expression.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -398,10 +409,11 @@ predicates.unlike("NAME", "%os%")
glob(field: string, value: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that matches the specified wildcard expression.
+Sets a **DataSharePredicates** object to match the data that matches the specified wildcard expression.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -428,10 +440,11 @@ predicates.glob("NAME", "?h*g")
between(field: string, low: ValueType, high: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is within the specified range, including the start and end values.
+Sets a **DataSharePredicates** object to match the data that is within the specified range, including the start and end values.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -459,10 +472,11 @@ predicates.between("AGE", 10, 50)
notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is out of the specified range, excluding the start and end values.
+Sets a **DataSharePredicates** object to match the data that is out of the specified range, excluding the start and end values.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -490,10 +504,11 @@ predicates.notBetween("AGE", 10, 50)
greaterThan(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is greater than the specified value.
+Sets a **DataSharePredicates** object to match the data that is greater than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -520,10 +535,11 @@ predicates.greaterThan("AGE", 10)
lessThan(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is less than the specified value.
+Sets a **DataSharePredicates** object to match the data that is less than the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -550,10 +566,11 @@ predicates.lessThan("AGE", 50)
greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is greater than or equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is greater than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -580,10 +597,11 @@ predicates.greaterThanOrEqualTo("AGE", 10)
lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is less than or equal to the specified value.
+Sets a **DataSharePredicates** object to match the data that is less than or equal to the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -672,6 +690,7 @@ Sets a **DataSharePredicates** object to filter out duplicate data records.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Return value**
@@ -725,6 +744,7 @@ Sets a **DataSharePredicates** object group the records according to the specifi
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -754,6 +774,7 @@ Sets a **DataSharePredicates** object to list data by the specified index.
Currently, only the RDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -779,7 +800,7 @@ predicates.indexedBy("SALARY_INDEX")
in(field: string, value: Array<ValueType>): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is within the specified value.
+Sets a **DataSharePredicates** object to match the data that is within the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
@@ -809,10 +830,11 @@ predicates.in("AGE", [18, 20])
notIn(field: string, value: Array<ValueType>): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data that is not in the specified value.
+Sets a **DataSharePredicates** object to match the data that is not in the specified value.
Currently, only the RDB and KVDB (schema) support this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -839,10 +861,11 @@ predicates.notIn("NAME", ["Lisa", "Rose"])
prefixKey(prefix: string): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data with the specified key prefix.
+Sets a **DataSharePredicates** object to match the data with the specified key prefix.
Currently, only the KVDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
@@ -868,10 +891,11 @@ predicates.prefixKey("NAME")
inKeys(keys: Array<string>): DataSharePredicates
-Sets a **DataSharePredicates** object to search for the data whose keys are within the given range.
+Sets a **DataSharePredicates** object to match the data whose keys are within the given range.
Currently, only the KVDB supports this **DataSharePredicates** object.
+**System API**: This is a system API.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
**Parameters**
diff --git a/en/application-dev/reference/apis/js-apis-data-distributedobject.md b/en/application-dev/reference/apis/js-apis-data-distributedobject.md
index 978cbffcf74444d9c902a91d72017d316f5ae5e8..8892f9ff2538ad00cebda30ba7b80fa3abf31641 100644
--- a/en/application-dev/reference/apis/js-apis-data-distributedobject.md
+++ b/en/application-dev/reference/apis/js-apis-data-distributedobject.md
@@ -23,10 +23,10 @@ Creates a distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| context | Context | Yes| Application context. For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md). For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md).|
-| source | object | Yes| Attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | context | Context | Yes| Application context. For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md). For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md).|
+ | source | object | Yes| Attributes of the distributed data object.|
**Return value**
@@ -75,9 +75,9 @@ Creates a random session ID.
**Return value**
-| Type| Description|
-| -------- | -------- |
-| string | Session ID created.|
+ | Type| Description|
+ | -------- | -------- |
+ | string | Session ID created.|
**Example**
@@ -124,18 +124,18 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| sessionId | string | Yes| ID of a distributed data object on a trusted network.|
-| callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the session ID is successfully set.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | sessionId | string | Yes| ID of a distributed data object on a trusted network.|
+ | callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the session ID is successfully set.|
**Error codes**
For details about the error codes, see [Distributed Data Object Error Codes](../errorcodes/errorcode-distributed-dataObject.md).
-| ID| Error Message|
-| -------- | -------- |
-| 15400001 | Failed to create the in-memory database.|
+ | ID| Error Message|
+ | -------- | -------- |
+ | 15400001 | Create table failed.|
**Example**
@@ -158,17 +158,17 @@ Exits all joined sessions.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the distributed data object exits all joined sessions.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<void> | Yes| Asynchronous callback invoked when the distributed data object exits all joined sessions.|
**Error codes**
For details about the error codes, see [Distributed Data Object Error Codes](../errorcodes/errorcode-distributed-dataObject.md).
-| ID| Error Message|
-| -------- | -------- |
-| 15400001 | Failed to create the in-memory database.|
+ | ID| Error Message|
+ | -------- | -------- |
+ | 15400001 | Create table failed.|
**Example**
@@ -195,9 +195,9 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
**Return value**
@@ -209,9 +209,9 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
For details about the error codes, see [Distributed Data Object Error Codes](../errorcodes/errorcode-distributed-dataObject.md).
-| ID| Error Message|
-| -------- | -------- |
-| 15400001 | Failed to create the in-memory database.|
+ | ID| Error Message|
+ | -------- | -------- |
+ | 15400001 | Create table failed.|
**Example**
@@ -240,10 +240,10 @@ Subscribes to data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -269,10 +269,10 @@ Unsubscribes from the data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -294,10 +294,10 @@ Subscribes to status changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
-| callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change. **sessionId** indicates the session ID of the distributed data object. **networkId** indicates the object device ID, that is, **deviceId**. **status** indicates the object status, which can be online or offline.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
+ | callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change. **sessionId** indicates the session ID of the distributed data object. **networkId** indicates the object device ID, that is, **deviceId**. **status** indicates the object status, which can be online or offline.|
**Example**
@@ -318,10 +318,10 @@ Unsubscribes from the status change of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
-| callback | Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }> | No| Callback for status changes. If this parameter is not specified, all status change callbacks of this distributed data object will be unsubscribed from. **sessionId** indicates the session ID of the distributed data object. **deviceId** indicates the device ID of the distributed data object. **status** indicates the object status, which can be online or offline.|
+ | callback | Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }> | No| Callback for status changes. If this parameter is not specified, all status change callbacks of this distributed data object will be unsubscribed from. **sessionId** indicates the session ID of the distributed data object. **deviceId** indicates the device ID of the distributed data object. **status** indicates the object status, which can be online or offline.|
**Example**
@@ -354,10 +354,10 @@ The saved data will be released in the following cases:
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| deviceId | string | Yes| ID of the device where data is stored. The value **local** indicates the local device.|
-| callback | AsyncCallback<[SaveSuccessResponse](#savesuccessresponse9)> | Yes| Callback invoked to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | deviceId | string | Yes| ID of the device where data is stored. The value **local** indicates the local device.|
+ | callback | AsyncCallback<[SaveSuccessResponse](#savesuccessresponse9)> | Yes| Callback invoked to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
**Example**
@@ -394,15 +394,15 @@ The saved data will be released in the following cases:
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| deviceId | string | Yes| ID of the device where the data is saved. The default value is **local**, which indicates the local device. |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | deviceId | string | Yes| ID of the device where the data is saved. The default value is **local**, which indicates the local device. |
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<[SaveSuccessResponse](#savesuccessresponse9)> | Promise used to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<[SaveSuccessResponse](#savesuccessresponse9)> | Promise used to return **SaveSuccessResponse**, which contains information such as session ID, version, and device ID.|
**Example**
@@ -423,7 +423,7 @@ g_object.save("local").then((result) => {
revokeSave(callback: AsyncCallback<RevokeSaveSuccessResponse>): void
-Revokes the saving operation of this distributed data object. This API uses an asynchronous callback to return the result.
+Revokes the data of this distributed data object saved. This API uses an asynchronous callback to return the result.
If the object is saved on the local device, the data saved on all trusted devices will be deleted.
If the object is stored on another device, the data on the local device will be deleted.
@@ -432,9 +432,9 @@ If the object is stored on another device, the data on the local device will be
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Yes| Callback invoked to return **RevokeSaveSuccessResponse**, which contains the session ID.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | callback | AsyncCallback<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Yes| Callback invoked to return **RevokeSaveSuccessResponse**, which contains the session ID.|
**Example**
@@ -468,7 +468,7 @@ g_object.revokeSave((err, result) => {
revokeSave(): Promise<RevokeSaveSuccessResponse>
-Revokes the saving operation of this distributed data object. This API uses a promise to return the result.
+Revokes the data of this distributed data object saved. This API uses a promise to return the result.
If the object is saved on the local device, the data saved on all trusted devices will be deleted.
If the object is stored on another device, the data on the local device will be deleted.
@@ -477,9 +477,9 @@ If the object is stored on another device, the data on the local device will be
**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Promise used to return **RevokeSaveSuccessResponse**, which contains the session ID.|
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<[RevokeSaveSuccessResponse](#revokesavesuccessresponse9)> | Promise used to return **RevokeSaveSuccessResponse**, which contains the session ID.|
**Example**
@@ -520,9 +520,9 @@ Creates a distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| source | object | Yes| Attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | source | object | Yes| Attributes of the distributed data object.|
**Return value**
@@ -558,15 +558,15 @@ Sets a session ID for synchronization. Automatic synchronization is performed fo
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | sessionId | string | No| ID of a distributed data object on a trusted network. To remove a distributed data object from the network, set this parameter to "" or leave it empty.|
**Return value**
-| Type| Description|
-| -------- | -------- |
-| boolean | Returns **true** if the session ID is set successfully; returns **false** otherwise. |
+ | Type| Description|
+ | -------- | -------- |
+ | boolean | Returns **true** if the session ID is set successfully; returns **false** otherwise. |
**Example**
@@ -593,10 +593,10 @@ Subscribes to data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **change**, which indicates data changes.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | Yes| Callback invoked to return the changes of the distributed data object. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -628,10 +628,10 @@ Unsubscribes from the data changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **change**, which indicates data changes.|
-| callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
+ | callback | Callback<{ sessionId: string, fields: Array<string> }> | No| Callback for data changes. If this parameter is not specified, all data change callbacks of this distributed data object will be unregistered. **sessionId** indicates the session ID of the distributed data object. **fields** indicates the changed attributes of the distributed data object.|
**Example**
@@ -659,10 +659,10 @@ Subscribes to status changes of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
-| callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change. **sessionId** indicates the session ID of the distributed data object. **networkId** indicates the object device ID, that is, **deviceId**. **status** indicates the object status, which can be online or offline.|
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | type | string | Yes| Event type to subscribe to. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
+ | callback | Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }> | Yes| Callback invoked to return the status change. **sessionId** indicates the session ID of the distributed data object. **networkId** indicates the object device ID, that is, **deviceId**. **status** indicates the object status, which can be online or offline.|
**Example**
@@ -689,8 +689,8 @@ Unsubscribes from the status change of this distributed data object.
**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
| type | string | Yes| Event type to unsubscribe from. The value is **status**, which indicates the status change (online or offline) of the distributed data object.|
| callback | Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }> | No| Callback for status changes. If this parameter is not specified, all status change callbacks of this distributed data object will be unregistered. **sessionId** indicates the session ID of the distributed data object. **deviceId** indicates the device ID of the distributed data object. **status** indicates the object status, which can be online or offline.|
diff --git a/en/application-dev/reference/apis/js-apis-data-preferences.md b/en/application-dev/reference/apis/js-apis-data-preferences.md
index 156078c63ad8f33a7747e493948f59d511a1c791..7ee96b8c97e6d294255a541fce2c392b04fc310f 100644
--- a/en/application-dev/reference/apis/js-apis-data-preferences.md
+++ b/en/application-dev/reference/apis/js-apis-data-preferences.md
@@ -185,7 +185,7 @@ For details about the error codes, see [User Preference Error Codes](../errorcod
| ID| Error Message |
| -------- | ------------------------------|
-| 15500010 | Failed to delete the preferences. |
+| 15500010 | Failed to delete preferences file. |
**Example**
@@ -197,7 +197,7 @@ import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
try {
- data_preferences.deletePreferences(context, 'mystore', function (err, val) {
+ data_preferences.deletePreferences(context, 'mystore', function (err) {
if (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
return;
@@ -217,7 +217,7 @@ import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
- data_preferences.deletePreferences(this.context, 'mystore', function (err, val) {
+ data_preferences.deletePreferences(this.context, 'mystore', function (err) {
if (err) {
console.info("Failed to delete the preferences. code =" + err.code + ", message =" + err.message);
return;
@@ -262,7 +262,7 @@ For details about the error codes, see [User Preference Error Codes](../errorcod
| ID| Error Message |
| -------- | ------------------------------|
-| 15500010 | Failed to delete the preferences. |
+| 15500010 | Failed to delete preferences file. |
**Example**
@@ -334,7 +334,7 @@ import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
try {
- data_preferences.removePreferencesFromCache(context, 'mystore', function (err, val) {
+ data_preferences.removePreferencesFromCache(context, 'mystore', function (err) {
if (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
return;
@@ -354,7 +354,7 @@ import UIAbility from '@ohos.app.ability.UIAbility';
class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage) {
try {
- data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err, val) {
+ data_preferences.removePreferencesFromCache(this.context, 'mystore', function (err) {
if (err) {
console.info("Failed to remove the preferences. code =" + err.code + ", message =" + err.message);
return;
diff --git a/en/application-dev/reference/apis/js-apis-data-relationalStore.md b/en/application-dev/reference/apis/js-apis-data-relationalStore.md
index 3e7e078f595f8468bf78cc953f5267c5515360a2..126dff90c4a6d06dfe675668409cf4d4d9573fa6 100644
--- a/en/application-dev/reference/apis/js-apis-data-relationalStore.md
+++ b/en/application-dev/reference/apis/js-apis-data-relationalStore.md
@@ -38,10 +38,11 @@ Obtains an RDB store. This API uses an asynchronous callback to return the resul
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
-| 14800011 | If failed open database by database corrupted. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800011 | Failed to open database by database corrupted. |
+| 14800000 | Inner error. |
**Example**
@@ -64,7 +65,7 @@ const STORE_CONFIG = {
relationalStore.getRdbStore(context, STORE_CONFIG, function (err, rdbStore) {
store = rdbStore;
if (err) {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Get RdbStore successfully.`);
@@ -87,7 +88,7 @@ class EntryAbility extends UIAbility {
relationalStore.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) {
store = rdbStore;
if (err) {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Get RdbStore successfully.`);
@@ -121,10 +122,11 @@ Obtains an RDB store. This API uses a promise to return the result. You can set
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
-| 14800011 | If failed open database by database corrupted. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800011 | Failed to open database by database corrupted. |
+| 14800000 | Inner error. |
**Example**
@@ -148,7 +150,7 @@ promise.then(async (rdbStore) => {
store = rdbStore;
console.info(`Get RdbStore successfully.`);
}).catch((err) => {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -170,7 +172,7 @@ class EntryAbility extends UIAbility {
store = rdbStore;
console.info(`Get RdbStore successfully.`)
}).catch((err) => {
- console.error(`Get RdbStore failed, err: ${err}`);
+ console.error(`Get RdbStore failed, code is ${err.code},message is ${err.message}`);
})
}
}
@@ -196,9 +198,10 @@ Deletes an RDB store. This API uses an asynchronous callback to return the resul
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800000 | Inner error. |
**Example**
@@ -212,7 +215,7 @@ let context = featureAbility.getContext()
relationalStore.deleteRdbStore(context, "RdbTest.db", function (err) {
if (err) {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete RdbStore successfully.`);
@@ -228,7 +231,7 @@ class EntryAbility extends UIAbility {
onWindowStageCreate(windowStage){
relationalStore.deleteRdbStore(this.context, "RdbTest.db", function (err) {
if (err) {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete RdbStore successfully.`);
@@ -262,9 +265,10 @@ Deletes an RDB store. This API uses a promise to return the result.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800010 | If failed delete database by invalid database name. |
+| **ID**| **Error Message** |
+| ------------ | ----------------------------------------------------------- |
+| 14800010 | Failed to open or delete database by invalid database path. |
+| 14800000 | Inner error. |
**Example**
@@ -280,7 +284,7 @@ let promise = relationalStore.deleteRdbStore(context, "RdbTest.db");
promise.then(()=>{
console.info(`Delete RdbStore successfully.`);
}).catch((err) => {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -295,7 +299,7 @@ class EntryAbility extends UIAbility {
promise.then(()=>{
console.info(`Delete RdbStore successfully.`);
}).catch((err) => {
- console.error(`Delete RdbStore failed, err: ${err}`);
+ console.error(`Delete RdbStore failed, code is ${err.code},message is ${err.message}`);
})
}
}
@@ -311,7 +315,7 @@ Defines the RDB store configuration.
| ------------- | ------------- | ---- | --------------------------------------------------------- |
| name | string | Yes | Database file name. |
| securityLevel | [SecurityLevel](#securitylevel) | Yes | Security level of the RDB store. |
-| encrypt | boolean | No | Whether to encrypt the RDB store. The value **true** means to encrypt the RDB store; the value **false** means the opposite.|
+| encrypt | boolean | No | Whether to encrypt the RDB store. The value **true** means to encrypt the RDB store; the value **false** (default) means the opposite.|
## SecurityLevel
@@ -319,7 +323,7 @@ Enumerates the RDB store security levels.
> **NOTE**
>
-> To perform data synchronization operations, the RDB store security level must be lower than or equal to that of the peer device. For details, see the [Cross-Device Data Synchronization Mechanism](../../database/sync-app-data-across-devices-overview.md#cross-device-data-synchronization-mechanism).
+> To perform data synchronization operations, the RDB store security level must be lower than or equal to that of the peer device. For details, see the [Cross-Device Data Synchronization Mechanism]( ../../database/sync-app-data-across-devices-overview.md#cross-device-data-synchronization-mechanism).
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
@@ -344,7 +348,7 @@ Defines the data types allowed.
## ValuesBucket
-Defines the types of the key and value in a KV pair.
+Defines the types of the key and value in a KV pair. This type is not multi-thread safe. If a **ValuesBucket** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
@@ -374,6 +378,7 @@ Defines the subscription type.
| Name | Value | Description |
| --------------------- | ---- | ------------------ |
| SUBSCRIBE_TYPE_REMOTE | 0 | Subscribe to remote data changes.|
+| SUBSCRIBE_TYPE_CLOUD10+ | 1 | Subscribe to cloud data changes.|
## ConflictResolution10+
@@ -392,7 +397,7 @@ Defines the resolution to use when **insert()** and **update()** conflict.
## RdbPredicates
-Defines the predicates for an RDB store. This class determines whether the conditional expression for the RDB store is true or false.
+Defines the predicates for an RDB store. This class determines whether the conditional expression for the RDB store is true or false. This type is not multi-thread safe. If an **RdbPredicates** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
### constructor
@@ -1289,9 +1294,10 @@ Inserts a row of data into a table. This API uses an asynchronous callback to re
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1304,7 +1310,7 @@ const valueBucket = {
};
store.insert("EMPLOYEE", valueBucket, function (err, rowId) {
if (err) {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Insert is successful, rowId = ${rowId}`);
@@ -1332,9 +1338,10 @@ Inserts a row of data into a table. This API uses an asynchronous callback to re
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1347,7 +1354,7 @@ const valueBucket = {
};
store.insert("EMPLOYEE", valueBucket, relationalStore.ConflictResolution.ON_CONFLICT_REPLACE, function (err, rowId) {
if (err) {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Insert is successful, rowId = ${rowId}`);
@@ -1379,9 +1386,10 @@ Inserts a row of data into a table. This API uses a promise to return the result
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1396,7 +1404,7 @@ let promise = store.insert("EMPLOYEE", valueBucket);
promise.then((rowId) => {
console.info(`Insert is successful, rowId = ${rowId}`);
}).catch((err) => {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1426,9 +1434,10 @@ Inserts a row of data into a table. This API uses a promise to return the result
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1443,7 +1452,7 @@ let promise = store.insert("EMPLOYEE", valueBucket, relationalStore.ConflictReso
promise.then((rowId) => {
console.info(`Insert is successful, rowId = ${rowId}`);
}).catch((err) => {
- console.error(`Insert is failed, err: ${err}`);
+ console.error(`Insert is failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1467,9 +1476,10 @@ Batch inserts data into a table. This API uses an asynchronous callback to retur
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1496,7 +1506,7 @@ const valueBucket3 = {
let valueBuckets = new Array(valueBucket1, valueBucket2, valueBucket3);
store.batchInsert("EMPLOYEE", valueBuckets, function(err, insertNum) {
if (err) {
- console.error(`batchInsert is failed, err: ${err}`);
+ console.error(`batchInsert is failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`batchInsert is successful, the number of values that were inserted = ${insertNum}`);
@@ -1528,9 +1538,10 @@ Batch inserts data into a table. This API uses a promise to return the result.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1559,7 +1570,7 @@ let promise = store.batchInsert("EMPLOYEE", valueBuckets);
promise.then((insertNum) => {
console.info(`batchInsert is successful, the number of values that were inserted = ${insertNum}`);
}).catch((err) => {
- console.error(`batchInsert is failed, err: ${err}`);
+ console.error(`batchInsert is failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1583,9 +1594,10 @@ Updates data in the RDB store based on the specified **RdbPredicates** object. T
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1600,7 +1612,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Lisa");
store.update(valueBucket, predicates, function (err, rows) {
if (err) {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Updated row count: ${rows}`);
@@ -1628,9 +1640,10 @@ Updates data in the RDB store based on the specified **RdbPredicates** object. T
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1645,7 +1658,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Lisa");
store.update(valueBucket, predicates, relationalStore.ConflictResolution.ON_CONFLICT_REPLACE, function (err, rows) {
if (err) {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Updated row count: ${rows}`);
@@ -1677,9 +1690,10 @@ Updates data based on the specified **RdbPredicates** object. This API uses a pr
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1696,7 +1710,7 @@ let promise = store.update(valueBucket, predicates);
promise.then(async (rows) => {
console.info(`Updated row count: ${rows}`);
}).catch((err) => {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1726,9 +1740,10 @@ Updates data based on the specified **RdbPredicates** object. This API uses a pr
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1745,7 +1760,7 @@ let promise = store.update(valueBucket, predicates, relationalStore.ConflictReso
promise.then(async (rows) => {
console.info(`Updated row count: ${rows}`);
}).catch((err) => {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1757,6 +1772,8 @@ Updates data based on the specified **DataSharePredicates** object. This API use
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1772,9 +1789,10 @@ Updates data based on the specified **DataSharePredicates** object. This API use
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1790,7 +1808,7 @@ let predicates = new dataSharePredicates.DataSharePredicates();
predicates.equalTo("NAME", "Lisa");
store.update("EMPLOYEE", valueBucket, predicates, function (err, rows) {
if (err) {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Updated row count: ${rows}`);
@@ -1805,6 +1823,8 @@ Updates data based on the specified **DataSharePredicates** object. This API use
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1825,9 +1845,10 @@ Updates data based on the specified **DataSharePredicates** object. This API use
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1845,7 +1866,7 @@ let promise = store.update("EMPLOYEE", valueBucket, predicates);
promise.then(async (rows) => {
console.info(`Updated row count: ${rows}`);
}).catch((err) => {
- console.error(`Updated failed, err: ${err}`);
+ console.error(`Updated failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1868,9 +1889,10 @@ Deletes data from the RDB store based on the specified **RdbPredicates** object.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1879,7 +1901,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Lisa");
store.delete(predicates, function (err, rows) {
if (err) {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete rows: ${rows}`);
@@ -1910,9 +1932,10 @@ Deletes data from the RDB store based on the specified **RdbPredicates** object.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1923,7 +1946,7 @@ let promise = store.delete(predicates);
promise.then((rows) => {
console.info(`Delete rows: ${rows}`);
}).catch((err) => {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -1935,6 +1958,8 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1949,9 +1974,10 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -1961,7 +1987,7 @@ let predicates = new dataSharePredicates.DataSharePredicates();
predicates.equalTo("NAME", "Lisa");
store.delete("EMPLOYEE", predicates, function (err, rows) {
if (err) {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete rows: ${rows}`);
@@ -1976,6 +2002,8 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -1995,9 +2023,10 @@ Deletes data from the RDB store based on the specified **DataSharePredicates** o
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2009,7 +2038,7 @@ let promise = store.delete("EMPLOYEE", predicates);
promise.then((rows) => {
console.info(`Delete rows: ${rows}`);
}).catch((err) => {
- console.error(`Delete failed, err: ${err}`);
+ console.error(`Delete failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2029,6 +2058,14 @@ Queries data from the RDB store based on specified conditions. This API uses an
| columns | Array<string> | Yes | Columns to query. If this parameter is not specified, the query applies to all columns. |
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2036,7 +2073,7 @@ let predicates = new relationalStore.RdbPredicates("EMPLOYEE");
predicates.equalTo("NAME", "Rose");
store.query(predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) {
if (err) {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2059,6 +2096,14 @@ Queries data from the RDB store based on specified conditions. This API uses a p
| predicates | [RdbPredicates](#rdbpredicates) | Yes | Query conditions specified by the **RdbPredicates** object. |
| columns | Array<string> | No | Columns to query. If this parameter is not specified, the query applies to all columns.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Return value**
| Type | Description |
@@ -2075,7 +2120,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2087,6 +2132,8 @@ Queries data from the RDB store based on specified conditions. This API uses an
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -2098,6 +2145,14 @@ Queries data from the RDB store based on specified conditions. This API uses an
| columns | Array<string> | Yes | Columns to query. If this parameter is not specified, the query applies to all columns. |
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2106,7 +2161,7 @@ let predicates = new dataSharePredicates.DataSharePredicates();
predicates.equalTo("NAME", "Rose");
store.query("EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"], function (err, resultSet) {
if (err) {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2122,6 +2177,8 @@ Queries data from the RDB store based on specified conditions. This API uses a p
**System capability**: SystemCapability.DistributedDataManager.RelationalStore.Core
+**Model restriction**: This API can be used only in the stage model.
+
**System API**: This is a system API.
**Parameters**
@@ -2138,6 +2195,14 @@ Queries data from the RDB store based on specified conditions. This API uses a p
| ------------------------------------------------------- | -------------------------------------------------- |
| Promise<[ResultSet](#resultset)> | Promise used to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2149,7 +2214,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2175,6 +2240,14 @@ Queries data from the RDB store of a remote device based on specified conditions
| columns | Array<string> | Yes | Columns to query. If this parameter is not specified, the query applies to all columns. |
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2197,7 +2270,7 @@ predicates.greaterThan("id", 0);
store.remoteQuery(deviceId, "EMPLOYEE", predicates, ["ID", "NAME", "AGE", "SALARY", "CODES"],
function(err, resultSet) {
if (err) {
- console.error(`Failed to remoteQuery, err: ${err}`);
+ console.error(`Failed to remoteQuery, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2233,6 +2306,14 @@ Queries data from the RDB store of a remote device based on specified conditions
| ------------------------------------------------------------ | -------------------------------------------------- |
| Promise<[ResultSet](#resultset)> | Promise used to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2257,7 +2338,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Failed to remoteQuery, err: ${err}`);
+ console.error(`Failed to remoteQuery, code is ${err.code},message is ${err.message}`);
})
```
@@ -2277,12 +2358,20 @@ Queries data using the specified SQL statement. This API uses an asynchronous ca
| bindArgs | Array<[ValueType](#valuetype)> | Yes | Arguments in the SQL statement. The value corresponds to the placeholders in the SQL parameter statement. If the SQL parameter statement is complete, the value of this parameter must be an empty array.|
| callback | AsyncCallback<[ResultSet](#resultset)> | Yes | Callback invoked to return the result. If the operation is successful, a **ResultSet** object will be returned. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.querySql("SELECT * FROM EMPLOYEE CROSS JOIN BOOK WHERE BOOK.NAME = ?", ['sanguo'], function (err, resultSet) {
if (err) {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ResultSet column names: ${resultSet.columnNames}`);
@@ -2311,6 +2400,14 @@ Queries data using the specified SQL statement. This API uses a promise to retur
| ------------------------------------------------------- | -------------------------------------------------- |
| Promise<[ResultSet](#resultset)> | Promise used to return the result. If the operation is successful, a **ResultSet** object will be returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2319,7 +2416,7 @@ promise.then((resultSet) => {
console.info(`ResultSet column names: ${resultSet.columnNames}`);
console.info(`ResultSet column count: ${resultSet.columnCount}`);
}).catch((err) => {
- console.error(`Query failed, err: ${err}`);
+ console.error(`Query failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2343,9 +2440,10 @@ Executes an SQL statement that contains specified arguments but returns no value
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2353,7 +2451,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const SQL_DELETE_TABLE = "DELETE FROM test WHERE name = ?"
store.executeSql(SQL_DELETE_TABLE, ['zhangsan'], function(err) {
if (err) {
- console.error(`ExecuteSql failed, err: ${err}`);
+ console.error(`ExecuteSql failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Delete table done.`);
@@ -2385,9 +2483,10 @@ Executes an SQL statement that contains specified arguments but returns no value
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2397,7 +2496,7 @@ let promise = store.executeSql(SQL_DELETE_TABLE);
promise.then(() => {
console.info(`Delete table done.`);
}).catch((err) => {
- console.error(`ExecuteSql failed, err: ${err}`);
+ console.error(`ExecuteSql failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2413,9 +2512,10 @@ Starts the transaction before executing an SQL statement.
For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
-| **ID**| **Error Message** |
-| ------------ | ----------------------- |
-| 14800047 | The WAL file size exceeds the default limit.|
+| **ID**| **Error Message** |
+| ------------ | -------------------------------------------- |
+| 14800047 | The WAL file size exceeds the default limit. |
+| 14800000 | Inner error. |
**Example**
@@ -2428,7 +2528,7 @@ const STORE_CONFIG = {
};
relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
if (err) {
- console.error(`GetRdbStore failed, err: ${err}`);
+ console.error(`GetRdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
store.beginTransaction();
@@ -2462,7 +2562,7 @@ const STORE_CONFIG = {
};
relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
if (err) {
- console.error(`GetRdbStore failed, err: ${err}`);
+ console.error(`GetRdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
store.beginTransaction();
@@ -2496,7 +2596,7 @@ const STORE_CONFIG = {
};
relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
if (err) {
- console.error(`GetRdbStore failed, err: ${err}`);
+ console.error(`GetRdbStore failed, code is ${err.code},message is ${err.message}`);
return;
}
try {
@@ -2511,7 +2611,7 @@ relationalStore.getRdbStore(context, STORE_CONFIG, async function (err, store) {
await store.insert("test", valueBucket);
store.commit();
} catch (err) {
- console.error(`Transaction failed, err: ${err}`);
+ console.error(`Transaction failed, code is ${err.code},message is ${err.message}`);
store.rollBack();
}
})
@@ -2532,12 +2632,20 @@ Backs up an RDB store. This API uses an asynchronous callback to return the resu
| destName | string | Yes | Name of the RDB store backup file.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.backup("dbBackup.db", function(err) {
if (err) {
- console.error(`Backup failed, err: ${err}`);
+ console.error(`Backup failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Backup success.`);
@@ -2564,6 +2672,14 @@ Backs up an RDB store. This API uses a promise to return the result.
| ------------------- | ------------------------- |
| Promise<void> | Promise that returns no value.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2571,7 +2687,7 @@ let promiseBackup = store.backup("dbBackup.db");
promiseBackup.then(()=>{
console.info(`Backup success.`);
}).catch((err)=>{
- console.error(`Backup failed, err: ${err}`);
+ console.error(`Backup failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2590,12 +2706,20 @@ Restores an RDB store from a backup file. This API uses an asynchronous callback
| srcName | string | Yes | Name of the RDB store backup file.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.restore("dbBackup.db", function(err) {
if (err) {
- console.error(`Restore failed, err: ${err}`);
+ console.error(`Restore failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Restore success.`);
@@ -2622,6 +2746,14 @@ Restores an RDB store from a backup file. This API uses a promise to return the
| ------------------- | ------------------------- |
| Promise<void> | Promise that returns no value.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2629,7 +2761,7 @@ let promiseRestore = store.restore("dbBackup.db");
promiseRestore.then(()=>{
console.info(`Restore success.`);
}).catch((err)=>{
- console.error(`Restore failed, err: ${err}`);
+ console.error(`Restore failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2650,12 +2782,20 @@ Sets distributed tables. This API uses an asynchronous callback to return the re
| tables | Array<string> | Yes | Names of the distributed tables to set.|
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
store.setDistributedTables(["EMPLOYEE"], function (err) {
if (err) {
- console.error(`SetDistributedTables failed, err: ${err}`);
+ console.error(`SetDistributedTables failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`SetDistributedTables successfully.`);
@@ -2684,6 +2824,14 @@ Sets distributed tables. This API uses a promise to return the result.
| ------------------- | ------------------------- |
| Promise<void> | Promise that returns no value.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2691,7 +2839,7 @@ let promise = store.setDistributedTables(["EMPLOYEE"]);
promise.then(() => {
console.info(`SetDistributedTables successfully.`);
}).catch((err) => {
- console.error(`SetDistributedTables failed, err: ${err}`);
+ console.error(`SetDistributedTables failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2717,6 +2865,14 @@ Obtains the distributed table name of a remote device based on the local table n
| table | string | Yes | Local table name of the remote device. |
| callback | AsyncCallback<string> | Yes | Callback invoked to return the result. If the operation succeeds, the distributed table name of the remote device is returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2736,7 +2892,7 @@ deviceManager.createDeviceManager("com.example.appdatamgrverify", (err, manager)
store.obtainDistributedTableName(deviceId, "EMPLOYEE", function (err, tableName) {
if (err) {
- console.error(`ObtainDistributedTableName failed, err: ${err}`);
+ console.error(`ObtainDistributedTableName failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`ObtainDistributedTableName successfully, tableName= ${tableName}`);
@@ -2770,6 +2926,14 @@ Obtains the distributed table name of a remote device based on the local table n
| --------------------- | ----------------------------------------------------- |
| Promise<string> | Promise used to return the result. If the operation succeeds, the distributed table name of the remote device is returned.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2791,7 +2955,7 @@ let promise = store.obtainDistributedTableName(deviceId, "EMPLOYEE");
promise.then((tableName) => {
console.info(`ObtainDistributedTableName successfully, tableName= ${tableName}`);
}).catch((err) => {
- console.error(`ObtainDistributedTableName failed, err: ${err}`);
+ console.error(`ObtainDistributedTableName failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2813,6 +2977,14 @@ Synchronizes data between devices. This API uses an asynchronous callback to ret
| predicates | [RdbPredicates](#rdbpredicates) | Yes | **RdbPredicates** object that specifies the data and devices to synchronize. |
| callback | AsyncCallback<Array<[string, number]>> | Yes | Callback invoked to send the synchronization result to the caller. **string** indicates the device ID. **number** indicates the synchronization status of that device. The value **0** indicates a successful synchronization. Other values indicate a synchronization failure. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2836,7 +3008,7 @@ let predicates = new relationalStore.RdbPredicates('EMPLOYEE');
predicates.inDevices(deviceIds);
store.sync(relationalStore.SyncMode.SYNC_MODE_PUSH, predicates, function (err, result) {
if (err) {
- console.error(`Sync failed, err: ${err}`);
+ console.error(`Sync failed, code is ${err.code},message is ${err.message}`);
return;
}
console.info(`Sync done.`);
@@ -2869,6 +3041,14 @@ Synchronizes data between devices. This API uses a promise to return the result.
| -------------------------------------------- | ------------------------------------------------------------ |
| Promise<Array<[string, number]>> | Promise used to send the synchronization result. **string** indicates the device ID. **number** indicates the synchronization status of that device. The value **0** indicates a successful synchronization. Other values indicate a synchronization failure. |
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ---------------------------- |
+| 14800000 | Inner error. |
+
**Example**
```js
@@ -2897,7 +3077,7 @@ promise.then((result) =>{
console.info(`device= ${result[i][0]}, status= ${result[i][1]}`);
}
}).catch((err) => {
- console.error(`Sync failed, err: ${err}`);
+ console.error(`Sync failed, code is ${err.code},message is ${err.message}`);
})
```
@@ -2915,7 +3095,7 @@ Registers an observer for this RDB store. When the data in the RDB store changes
| -------- | ----------------------------------- | ---- | ------------------------------------------- |
| event | string | Yes | Event to observe. The value is **dataChange**, which indicates a data change event. |
| type | [SubscribeType](#subscribetype) | Yes | Subscription type to register.|
-| observer | Callback<Array<string>> | Yes | Callback invoked to return the data change event. |
+| observer | Callback<Array<string>> | Yes | Callback invoked to return the data change event. **Array** indicates the IDs of the peer devices whose data in the database is changed.|
**Example**
@@ -2928,7 +3108,7 @@ function storeObserver(devices) {
try {
store.on('dataChange', relationalStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver);
} catch (err) {
- console.error(`Register observer failed, err: ${err}`);
+ console.error(`Register observer failed, code is ${err.code},message is ${err.message}`);
}
```
@@ -2944,9 +3124,9 @@ Unregisters the observer of the specified type from the RDB store. This API uses
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------- | ---- | ------------------------------------------ |
-| event | string | Yes | Event type. The value is **dataChange**, which indicates a data change event. |
-| type | [SubscribeType](#subscribetype) | Yes | Subscription type to unregister. |
-| observer | Callback<Array<string>> | Yes | Callback for the data change event. |
+| event | string | Yes | Event type. The value is **dataChange**, which indicates a data change event. |
+| type | [SubscribeType](#subscribetype) | Yes | Subscription type to unregister. |
+| observer | Callback<Array<string>> | Yes | Callback for the data change event. **Array** indicates the IDs of the peer devices whose data in the database is changed.|
**Example**
@@ -2959,7 +3139,7 @@ function storeObserver(devices) {
try {
store.off('dataChange', relationalStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE, storeObserver);
} catch (err) {
- console.error(`Unregister observer failed, err: ${err}`);
+ console.error(`Unregister observer failed, code is ${err.code},message is ${err.message}`);
}
```
@@ -3099,7 +3279,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3110,7 +3290,7 @@ promise.then((resultSet) => {
resultSet.goTo(1);
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3140,7 +3320,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3151,7 +3331,7 @@ promise.then((resultSet) => {
resultSet.goToRow(5);
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3176,7 +3356,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3187,7 +3367,7 @@ promise.then((resultSet) => {
resultSet.goToFirstRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3211,7 +3391,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3222,7 +3402,7 @@ promise.then((resultSet) => {
resultSet.goToLastRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3246,7 +3426,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3257,7 +3437,7 @@ promise.then((resultSet) => {
resultSet.goToNextRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3281,7 +3461,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
+| 14800012 | The result set is empty or the specified location is invalid. |
**Example**
@@ -3292,7 +3472,7 @@ promise.then((resultSet) => {
resultSet.goToPreviousRow();
resultSet.close();
}).catch((err) => {
- console.error(`query failed, err: ${err}`);
+ console.error(`query failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3316,6 +3496,14 @@ Obtains the value in the form of a byte array based on the specified column and
| ---------- | -------------------------------- |
| Uint8Array | Value obtained.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
+
**Example**
```js
@@ -3342,6 +3530,14 @@ Obtains the value in the form of a string based on the specified column and the
| ------ | ---------------------------- |
| string | String obtained.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
+
**Example**
```js
@@ -3366,7 +3562,15 @@ Obtains the value of the Long type based on the specified column and the current
| Type | Description |
| ------ | ------------------------------------------------------------ |
-| number | Value obtained. The value range supported by this API is **Number.MIN_SAFE_INTEGER** to **Number.MAX_SAFE_INTEGER**. If the value is out of this range, use [getDouble](#getdouble).|
+| number | Value obtained. The value range supported by API is **Number.MIN_SAFE_INTEGER** to **Number.MAX_SAFE_INTEGER**. If the value is out of this range, use [getDouble](#getdouble).|
+
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
**Example**
@@ -3394,6 +3598,14 @@ Obtains the value of the double type based on the specified column and the curre
| ------ | ---------------------------- |
| number | Value obtained.|
+**Error codes**
+
+For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode-data-rdb.md).
+
+| **ID**| **Error Message** |
+| ------------ | ------------------------------------------------------------ |
+| 14800013 | The column value is null or the column type is incompatible. |
+
**Example**
```js
@@ -3450,7 +3662,7 @@ let promiseClose = store.query(predicatesClose, ["ID", "NAME", "AGE", "SALARY",
promiseClose.then((resultSet) => {
resultSet.close();
}).catch((err) => {
- console.error(`resultset close failed, err: ${err}`);
+ console.error(`resultset close failed, code is ${err.code},message is ${err.message}`);
});
```
@@ -3460,6 +3672,4 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
| **ID**| **Error Message** |
| ------------ | ------------------------------------------------------------ |
-| 14800012 | The result set is empty or the specified location is invalid. |
-
-
+| 14800012 | The result set is empty or the specified location is invalid. |
diff --git a/en/application-dev/reference/apis/js-apis-data-valuesBucket.md b/en/application-dev/reference/apis/js-apis-data-valuesBucket.md
index 009ff71b091c7d91a92d92364450316e3aeecfa2..ee21647ac71dacf7afa8240d2aa93e2ea65967f4 100644
--- a/en/application-dev/reference/apis/js-apis-data-valuesBucket.md
+++ b/en/application-dev/reference/apis/js-apis-data-valuesBucket.md
@@ -1,4 +1,4 @@
-# @ohos.data.ValuesBucket (Value Bucket)
+# @ohos.data.ValuesBucket (Data Set)
The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to insert data into a database.
@@ -6,7 +6,6 @@ The **ValueBucket** module holds data in key-value (KV) pairs. You can use it to
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
-> The APIs provided by this module are system APIs.
## Modules to Import
@@ -30,7 +29,7 @@ Enumerates the value types allowed by the database.
## ValuesBucket
-Defines the types of the key and value in a KV pair.
+Defines the types of the key and value in a KV pair. This type is not multi-thread safe. If a **ValuesBucket** instance is operated by multiple threads at the same time in an application, use a lock for the instance.
**System capability**: SystemCapability.DistributedDataManager.DataShare.Core
diff --git a/en/application-dev/reference/apis/js-apis-device-manager.md b/en/application-dev/reference/apis/js-apis-device-manager.md
index 16ec1aec98084c7e3551e4a77406930b17cde50f..8528ceff015caa6e24cbec8ed4acd87098a67da1 100644
--- a/en/application-dev/reference/apis/js-apis-device-manager.md
+++ b/en/application-dev/reference/apis/js-apis-device-manager.md
@@ -39,15 +39,6 @@ Creates a **DeviceManager** instance.
| bundleName | string | Yes | Bundle name of the application. |
| callback | AsyncCallback<[DeviceManager](#devicemanager)> | Yes | Callback used to return the **DeviceManager** instance created.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| -------- | --------------------------------------------------------------- |
-| 11600101 | Failed to execute the function. |
-| 11600102 | Failed to obtain the service. |
-
**Example**
```js
@@ -199,7 +190,7 @@ Defines the authentication parameters.
| Name | Type | Mandatory | Description |
| --------- | -------------------- | ---- | ---------- |
| authType | number | Yes | Authentication type. |
-| extraInfo | {[key:string] : any} | No | Extended field.|
+| extraInfo | {[key:string] : any} | No | Extended field. Optional. The default value is **undefined**.|
## AuthInfo
@@ -211,7 +202,7 @@ Defines authentication information.
| --------- | -------------------- | ---- | ---------- |
| authType | number | Yes | Authentication type. |
| token | number | Yes | Authentication token. |
-| extraInfo | {[key:string] : any} | No | Extended field.|
+| extraInfo | {[key:string] : any} | No | Extended field. Optional. The default value is **undefined**.|
## PublishInfo9+
@@ -302,14 +293,6 @@ Obtains all trusted devices. This API uses an asynchronous callback to return th
| -------- | ---------------------------------------- | ---- | --------------------- |
| callback | AsyncCallback<Array<[DeviceInfo](#deviceinfo)>> | Yes | Callback used to return the list of trusted devices.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| -------- | --------------------------------------------------------------- |
-| 11600101 | Failed to execute the function. |
-
**Example**
```js
@@ -338,7 +321,7 @@ Obtains all trusted devices. This API uses a promise to return the result.
| Type | Description |
| ---------------------------------------- | --------------------- |
- | Promise<Array<[DeviceInfo](#deviceinfo)>> | Promise used to return the list of trusted devices.|
+ | Promise<Array<[DeviceInfo](#deviceinfo)>> | Promise used to return the result.|
**Error codes**
@@ -404,14 +387,6 @@ Obtains local device information. This API uses an asynchronous callback to retu
| -------- | ---------------------------------------- | ---- | --------- |
| callback | AsyncCallback<[DeviceInfo](#deviceinfo)> | Yes | Callback used to return the local device information.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| -------- | --------------------------------------------------------------- |
-| 11600101 | Failed to execute the function. |
-
**Example**
```js
@@ -440,7 +415,7 @@ Obtains local device information. This API uses a promise to return the result.
| Type | Description |
| ---------------------------------------- | --------------------- |
- | Promise<[DeviceInfo](#deviceinfo)> | Promise used to return the local device information.|
+ | Promise<[DeviceInfo](#deviceinfo)> | Promise used to return the result.|
**Error codes**
@@ -475,18 +450,12 @@ Obtains the information about a specific device based on the network ID. This AP
| networkId| string | Yes | Network ID of the device.|
| callback | AsyncCallback<[DeviceInfo](#deviceinfo)> | Yes | Callback used to return the information about the specified device.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| -------- | --------------------------------------------------------------- |
-| 11600101 | Failed to execute the function. |
-
**Example**
```js
try {
+ // Network ID of the device, which can be obtained from the trusted device list
+ let networkId = "xxxxxxx"
dmInstance.getDeviceInfo(networkId, (err, data) => {
if (err) {
console.error("getDeviceInfo errCode:" + err.code + ",errMessage:" + err.message);
@@ -519,17 +488,11 @@ Obtains the information about a specific device based on the network ID. This AP
| ---------------------------------------- | --------------------- |
| Promise<[DeviceInfo](#deviceinfo)> | Promise used to return the result.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| ------- | --------------------------------------------------------------- |
-| 11600101| Failed to execute the function. |
-
**Example**
```js
+ // Network ID of the device, which can be obtained from the trusted device list
+ let networkId = "xxxxxxx"
dmInstance.getDeviceInfo(networkId).then((data) => {
console.log('get device info: ' + JSON.stringify(data));
}).catch((err) => {
@@ -541,7 +504,7 @@ For details about the error codes, see [Device Management Error Codes](../errorc
startDeviceDiscovery(subscribeInfo: SubscribeInfo): void
-Starts to discover peripheral devices.
+Starts to discover peripheral devices. The discovery process automatically stops when 2 minutes have elapsed. A maximum of 99 devices can be discovered.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
@@ -575,7 +538,7 @@ For details about the error codes, see [Device Management Error Codes](../errorc
"capability": 1
};
try {
- dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is invoked to notify the application when a device is discovered.
+ dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered.
} catch (err) {
console.error("startDeviceDiscovery errCode:" + err.code + ",errMessage:" + err.message);
}
@@ -585,7 +548,7 @@ For details about the error codes, see [Device Management Error Codes](../errorc
startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void
-Starts to discover peripheral devices and filters discovered devices.
+Starts to discover peripheral devices and filters discovered devices. The discovery process automatically stops when 2 minutes have elapsed. A maximum of 99 devices can be discovered.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
@@ -594,7 +557,7 @@ Starts to discover peripheral devices and filters discovered devices.
| Name | Type | Mandatory | Description |
| ------------- | ------------------------------- | ---- | ----- |
| subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.|
- | filterOptions | string | No | Options for filtering discovered devices.|
+ | filterOptions | string | No | Options for filtering discovered devices. Optional. The default value is **undefined**, indicating that discovery of offline devices.|
**Error codes**
@@ -673,7 +636,7 @@ For details about the error codes, see [Device Management Error Codes](../errorc
publishDeviceDiscovery(publishInfo: PublishInfo): void
-Publishes device information for discovery purposes.
+Publishes device information for discovery purposes. The publish process automatically stops when 2 minutes have elapsed.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
@@ -760,15 +723,6 @@ Authenticates a device.
| authParam | [AuthParam](#authparam) | Yes | Authentication parameter. |
| callback | AsyncCallback<{deviceId: string, pinToken ?: number}> | Yes | Callback used to return the authentication result.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| -------- | --------------------------------------------------------------- |
-| 11600101 | Failed to execute the function. |
-| 11600103 | Authentication invalid. |
-
**Example**
```js
@@ -858,14 +812,6 @@ Verifies authentication information.
| authInfo | [AuthInfo](#authinfo) | Yes | Authentication information. |
| callback | AsyncCallback<{deviceId: string, level: number}> | Yes | Callback used to return the verification result.|
-**Error codes**
-
-For details about the error codes, see [Device Management Error Codes](../errorcodes/errorcode-device-manager.md).
-
-| ID| Error Message |
-| -------- | --------------------------------------------------------------- |
-| 11600101 | Failed to execute the function. |
-
**Example**
```js
@@ -944,11 +890,11 @@ Obtains the registration information of the credential.
"userId" : "123"
}
try {
- dmClass.requestCredentialRegisterInfo(credentialInfo, (data) => {
+ dmInstance.requestCredentialRegisterInfo(credentialInfo, (data) => {
if (data) {
console.info("requestCredentialRegisterInfo result:" + JSON.stringify(data));
} else {
- console.info.push("requestCredentialRegisterInfo result: data is null");
+ console.info("requestCredentialRegisterInfo result: data is null");
}
});
} catch (err) {
@@ -995,11 +941,11 @@ Imports credential information.
]
}
try {
- dmClass.importCredential(credentialInfo, (data) => {
+ dmInstance.importCredential(credentialInfo, (data) => {
if (data) {
console.info("importCredential result:" + JSON.stringify(data));
} else {
- console.info.push("importCredential result: data is null");
+ console.info("importCredential result: data is null");
}
});
} catch (err) {
@@ -1031,11 +977,11 @@ Deletes credential information.
"userId" : "123"
}
try {
- dmClass.deleteCredential(queryInfo, (data) => {
+ dmInstance.deleteCredential(queryInfo, (data) => {
if (data) {
console.info("deleteCredential result:" + JSON.stringify(data));
} else {
- console.info.push("deleteCredential result: data is null");
+ console.info("deleteCredential result: data is null");
}
});
} catch (err) {
diff --git a/en/application-dev/reference/apis/js-apis-distributed-account.md b/en/application-dev/reference/apis/js-apis-distributed-account.md
index 0ec67bc229c124cdf36a289e7321acaa9c2fcd43..5ea4792ec68bf59975274abd5cb7e0a58f8c1188 100644
--- a/en/application-dev/reference/apis/js-apis-distributed-account.md
+++ b/en/application-dev/reference/apis/js-apis-distributed-account.md
@@ -62,12 +62,14 @@ Obtains distributed account information. This API uses an asynchronous callback
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
try {
accountAbility.getOsAccountDistributedInfo((err, data) => {
- console.log("getOsAccountDistributedInfo err: " + JSON.stringify(err));
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ if (err) {
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }
});
- } catch (e) {
- console.log("getOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
@@ -98,15 +100,96 @@ Obtains distributed account information. This API uses a promise to return the r
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
try {
accountAbility.getOsAccountDistributedInfo().then((data) => {
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ console.log('distributed information: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("getOsAccountDistributedInfo err: " + JSON.stringify(err));
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
- } catch (e) {
- console.log("getOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('getOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
+
+### getOsAccountDistributedInfoByLocalId10+
+
+getOsAccountDistributedInfoByLocalId(localId: number, callback: AsyncCallback<DistributedInfo>): void
+
+Obtains distributed information about an OS account. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | localId | number | Yes| ID of the target OS account.|
+ | callback | AsyncCallback<[DistributedInfo](#distributedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **data** is the distributed account information obtained. Otherwise, **err** is an error object.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300003 | Account not found. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ try {
+ accountAbility.getOsAccountDistributedInfoByLocalId(100, (err, data) => {
+ if (err) {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ } else {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }
+ });
+ } catch (err) {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
+### getOsAccountDistributedInfoByLocalId10+
+
+getOsAccountDistributedInfoByLocalId(localId: number): Promise<DistributedInfo>
+
+Obtains distributed information about an OS account. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
+
+**Return value**
+
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<[DistributedInfo](#distributedinfo)> | Promise used to return the distributed account information obtained.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300003 | Account not found. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ try {
+ accountAbility.getOsAccountDistributedInfoByLocalId(100).then((data) => {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }).catch((err) => {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ });
+ } catch (err) {
+ console.log('getOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
### queryOsAccountDistributedInfo(deprecated)
queryOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): void
@@ -130,9 +213,11 @@ Obtains distributed account information. This API uses an asynchronous callback
```js
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
accountAbility.queryOsAccountDistributedInfo((err, data) => {
- console.log("queryOsAccountDistributedInfo err: " + JSON.stringify(err));
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ if (err) {
+ console.log('queryOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('distributed information: ' + JSON.stringify(data));
+ }
});
```
@@ -160,10 +245,9 @@ Obtains distributed account information. This API uses a promise to return the r
```js
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
accountAbility.queryOsAccountDistributedInfo().then((data) => {
- console.log('Query account info name: ' + data.name);
- console.log('Query account info id: ' + data.id);
+ console.log('distributed information: ' + JSON.stringify(data));
}).catch((err) => {
- console.log("queryOsAccountDistributedInfoerr: " + JSON.stringify(err));
+ console.log('queryOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
```
@@ -198,10 +282,14 @@ Sets the distributed account information. This API uses an asynchronous callback
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
try {
accountAbility.setOsAccountDistributedInfo(accountInfo, (err) => {
- console.log("setOsAccountDistributedInfo err: " + JSON.stringify(err));
+ if (err) {
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('setOsAccountDistributedInfo successfully');
+ }
});
- } catch (e) {
- console.log("setOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
@@ -241,14 +329,109 @@ Sets the distributed account information. This API uses a promise to return the
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
try {
accountAbility.setOsAccountDistributedInfo(accountInfo).then(() => {
- console.log('setOsAccountDistributedInfo Success');
+ console.log('setOsAccountDistributedInfo successfully');
}).catch((err) => {
- console.log("setOsAccountDistributedInfo err: " + JSON.stringify(err));
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
- } catch (e) {
- console.log("setOsAccountDistributedInfo exception: " + JSON.stringify(e));
+ } catch (err) {
+ console.log('setOsAccountDistributedInfo exception: ' + JSON.stringify(err));
}
```
+### setOsAccountDistributedInfoByLocalId10+
+
+setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: DistributedInfo, callback: AsyncCallback<void>): void
+
+Sets the distributed information for an OS account. This API uses an asynchronous callback to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | localId | number | Yes| ID of the target OS account.|
+ | accountInfo | [DistributedInfo](#distributedinfo) | Yes| Distributed account information to set.|
+ | callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the distributed information is set successfully, **err** is **undefined**. Otherwise, **err** is an error object.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300002 | Invalid distributedInfo. |
+| 12300003 | Account identified by localId or by distributedInfo not found. |
+| 12300008 | Restricted OS account. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
+ try {
+ accountAbility.setOsAccountDistributedInfoByLocalId(100, accountInfo, (err) => {
+ if (err) {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ } else {
+ console.log('setOsAccountDistributedInfoByLocalId successfully');
+ }
+ });
+ } catch (err) {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
+### setOsAccountDistributedInfoByLocalId10+
+
+setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: DistributedInfo): Promise<void>
+
+Sets the distributed information for an OS account. This API uses a promise to return the result.
+
+**System API**: This is a system API.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+**Required permissions**: ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
+
+**Parameters**
+
+ | Name| Type| Mandatory| Description|
+ | -------- | -------- | -------- | -------- |
+ | localId | number | Yes| ID of the target OS account.|
+ | distributedInfo | [DistributedInfo](#distributedinfo) | Yes| Distributed account information to set.|
+
+**Return value**
+
+ | Type| Description|
+ | -------- | -------- |
+ | Promise<void> | Promise that returns no value.|
+
+**Error codes**
+
+| ID| Error Message|
+| -------- | ------------------- |
+| 12300001 | System service exception. |
+| 12300002 | Invalid distributedInfo. |
+| 12300003 | Account identified by localId or by distributedInfo not found. |
+| 12300008 | Restricted OS account. |
+
+**Example**
+ ```js
+ const accountAbility = account_distributedAccount.getDistributedAccountAbility();
+ let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
+ try {
+ accountAbility.setOsAccountDistributedInfoByLocalId(100, accountInfo).then(() => {
+ console.log('setOsAccountDistributedInfoByLocalId successfully');
+ }).catch((err) => {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ });
+ } catch (err) {
+ console.log('setOsAccountDistributedInfoByLocalId exception: ' + JSON.stringify(err));
+ }
+ ```
+
### updateOsAccountDistributedInfo(deprecated)
updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback<void>): void
@@ -275,7 +458,11 @@ Updates the distributed account information. This API uses an asynchronous callb
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
accountAbility.updateOsAccountDistributedInfo(accountInfo, (err) => {
- console.log("queryOsAccountDistributedInfo err: " + JSON.stringify(err));
+ if (err) {
+ console.log('queryOsAccountDistributedInfo exception: ' + JSON.stringify(err));
+ } else {
+ console.log('queryOsAccountDistributedInfo successfully');
+ }
});
```
@@ -308,22 +495,34 @@ Updates the distributed account information. This API uses a promise to return t
const accountAbility = account_distributedAccount.getDistributedAccountAbility();
let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
accountAbility.updateOsAccountDistributedInfo(accountInfo).then(() => {
- console.log('updateOsAccountDistributedInfo Success');
+ console.log('updateOsAccountDistributedInfo successfully');
}).catch((err) => {
- console.log("updateOsAccountDistributedInfo err: " + JSON.stringify(err));
+ console.log('updateOsAccountDistributedInfo exception: ' + JSON.stringify(err));
});
```
## DistributedInfo
-Defines distributed OS account information.
+Defines the distributed information about an OS account.
+
+**System capability**: SystemCapability.Account.OsAccount
+
+| Name| Type| Read-only| Mandatory| Description|
+| -------- | -------- | -------- |-------- | -------- |
+| name | string | No|Yes| Name of the distributed account. It must be a non-null string.|
+| id | string | No|Yes| UID of the distributed account. It must be a non-null string.|
+| event | string | No|Yes| Login state of the distributed account. The state can be login, logout, token invalid, or logoff, which correspond to the following strings respectively: - Ohos.account.event.LOGIN - Ohos.account.event.LOGOUT - Ohos.account.event.TOKEN_INVALID - Ohos.account.event.LOGOFF |
+| nickname9+ | string | No|No| Nickname of the distributed account. By default, no value is passed.|
+| avatar9+ | string | No|No| Avatar of the distributed account. By default, no value is passed.|
+| status10+ | [DistributedAccountStatus](#distributedaccountstatus10) | Yes|No| Status of the distributed account. The value is of the enumerated type. The default status is unlogged.|
+| scalableData8+ | object | No|No| Extended information about the distributed account, passed in key-value (KV) pairs based on service requirements. By default, no value is passed.|
+
+## DistributedAccountStatus10+
+
+Enumerates the statuses of a distributed account.
**System capability**: SystemCapability.Account.OsAccount
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| name | string | Yes| Name of the distributed account. It must be a non-null string.|
-| id | string | Yes| UID of the distributed account. It must be a non-null string.|
-| event | string | Yes| Login state of the distributed account. The state can be login, logout, token invalid, or logoff, which correspond to the following strings respectively: - Ohos.account.event.LOGIN - Ohos.account.event.LOGOUT - Ohos.account.event.TOKEN_INVALID - Ohos.account.event.LOGOFF |
-| nickname9+ | string | No| Nickname of the distributed account. It must be a non-null string.|
-| avatar9+ | string | No| Avatar of the distributed account. It must be a non-null string.|
-| scalableData8+ | object | No| Extended information about the distributed account, passed in key-value (KV) pairs. **NOTE** This parameter is reserved and not used in the setters and getters.|
+| Name | Value| Description |
+| ---- | ------ | ----------- |
+| NOT_LOGGED_IN | 0 | The account has not logged in.|
+| LOGGED_IN | 1 | The account has logged in.|
diff --git a/en/application-dev/reference/apis/js-apis-distributed-data.md b/en/application-dev/reference/apis/js-apis-distributed-data.md
index cd25c298b90c6f59cba4e2d86f79650991eb7ab8..51c73ee6de1bf48c0417819f6bc9cdd8222981f4 100644
--- a/en/application-dev/reference/apis/js-apis-distributed-data.md
+++ b/en/application-dev/reference/apis/js-apis-distributed-data.md
@@ -3768,7 +3768,7 @@ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void
Synchronizes the KV store manually.
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -3778,9 +3778,9 @@ Synchronizes the KV store manually.
| Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------------------------- |
-| deviceIds | string[] | Yes | List of IDs of the devices in the same networking environment to be synchronized.|
+| deviceIds | string[] | Yes | List of **networkId**s of the devices in the same networking environment to be synchronized.|
| mode | [SyncMode](#syncmode) | Yes | Synchronization mode. |
-| delayMs | number | No | Allowed synchronization delay time, in ms. |
+| delayMs | number | No | Delay time allowed, in milliseconds. The default value is **0**. |
**Example**
@@ -3799,7 +3799,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
@@ -5246,7 +5246,7 @@ Synchronizes the KV store manually.
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -5256,7 +5256,7 @@ Synchronizes the KV store manually.
| Name | Type| Mandatory | Description |
| ----- | ------ | ---- | ----------------------- |
-| deviceIds |string[] | Yes |IDs of the devices to be synchronized.|
+| deviceIds |string[] | Yes |**networkId**s of the devices to be synchronized.|
| mode |[SyncMode](#syncmode) | Yes |Synchronization mode. |
| delayMs |number | No |Allowed synchronization delay time, in ms. The default value is **0**. |
@@ -5277,7 +5277,7 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
diff --git a/en/application-dev/reference/apis/js-apis-distributedKVStore.md b/en/application-dev/reference/apis/js-apis-distributedKVStore.md
index 117afe8d4f70bb034add259da1a09d3b58b680ba..3d2441aa70b66ffb01e9bc19eb0f38156f912e50 100644
--- a/en/application-dev/reference/apis/js-apis-distributedKVStore.md
+++ b/en/application-dev/reference/apis/js-apis-distributedKVStore.md
@@ -127,7 +127,7 @@ Enumerates the distributed KV store types.
| Name | Description |
| -------------------- | ------------------------------------------------------------ |
-| DEVICE_COLLABORATION | Device KV store. The device KV store manages data by device, which eliminates conflicts. Data can be queried by device. **System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore |
+| DEVICE_COLLABORATION | Device KV store. The device KV store manages data by device, which eliminates conflicts. Data can be queried by device. **System capability**: SystemCapability.DistributedDataManager.KVStore.DistributedKVStore|
| SINGLE_VERSION | Single KV store. The single KV store does not differentiate data by device. If entries with the same key are modified on different devices, the value will be overwritten. **System capability**: SystemCapability.DistributedDataManager.KVStore.Core |
## SecurityLevel
@@ -457,7 +457,7 @@ try {
kvStore = store;
kvStore = null;
store = null;
- kvManager.closeKVStore('appId', 'storeId', function (err, data) {
+ kvManager.closeKVStore('appId', 'storeId', function (err) {
if (err != undefined) {
console.error(`Failed to close KVStore.code is ${err.code},message is ${err.message}`);
return;
@@ -568,7 +568,7 @@ try {
kvStore = store;
kvStore = null;
store = null;
- kvManager.deleteKVStore('appId', 'storeId', function (err, data) {
+ kvManager.deleteKVStore('appId', 'storeId', function (err) {
if (err != undefined) {
console.error(`Failed to delete KVStore.code is ${err.code},message is ${err.message}`);
return;
@@ -2128,7 +2128,7 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -2182,8 +2182,8 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting.data=${data}`);
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
}).catch((err) => {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
});
@@ -2239,7 +2239,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -2311,7 +2311,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (entries) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries');
@@ -2372,7 +2372,7 @@ try {
v8Arr.push(vb1);
v8Arr.push(vb2);
v8Arr.push(vb3);
- kvStore.putBatch(v8Arr, async function (err, data) {
+ kvStore.putBatch(v8Arr, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -2434,7 +2434,7 @@ try {
v8Arr.push(vb1);
v8Arr.push(vb2);
v8Arr.push(vb3);
- kvStore.putBatch(v8Arr).then(async (data) => {
+ kvStore.putBatch(v8Arr).then(async () => {
console.info(`Succeeded in putting patch`);
}).catch((err) => {
console.error(`putBatch fail.code is ${err.code},message is ${err.message}`);
@@ -2480,13 +2480,13 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
}
console.info('Succeeded in putting');
- kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.delete(KEY_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
return;
@@ -2540,9 +2540,9 @@ For details about the error codes, see [RDB Error Codes](../errorcodes/errorcode
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting: ${data}`);
- kvStore.delete(KEY_TEST_STRING_ELEMENT).then((data) => {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
+ kvStore.delete(KEY_TEST_STRING_ELEMENT).then(() => {
console.info('Succeeded in deleting');
}).catch((err) => {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
@@ -2595,13 +2595,13 @@ try {
let predicates = new dataSharePredicates.DataSharePredicates();
let arr = ["name"];
predicates.inKeys(arr);
- kvStore.put("name", "bob", function (err, data) {
+ kvStore.put("name", "bob", function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
}
console.info("Succeeded in putting");
- kvStore.delete(predicates, function (err, data) {
+ kvStore.delete(predicates, function (err) {
if (err == undefined) {
console.info('Succeeded in deleting');
} else {
@@ -2660,9 +2660,9 @@ try {
let predicates = new dataSharePredicates.DataSharePredicates();
let arr = ["name"];
predicates.inKeys(arr);
- kvStore.put("name", "bob").then((data) => {
- console.info(`Succeeded in putting: ${data}`);
- kvStore.delete(predicates).then((data) => {
+ kvStore.put("name", "bob").then(() => {
+ console.info(`Succeeded in putting data`);
+ kvStore.delete(predicates).then(() => {
console.info('Succeeded in deleting');
}).catch((err) => {
console.error(`Failed to delete.code is ${err.code},message is ${err.message}`);
@@ -2724,13 +2724,13 @@ try {
keys.push(key + i);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
}
console.info('Succeeded in putting Batch');
- kvStore.deleteBatch(keys, async function (err, data) {
+ kvStore.deleteBatch(keys, async function (err) {
if (err != undefined) {
console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -2797,9 +2797,9 @@ try {
keys.push(key + i);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (data) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
- kvStore.deleteBatch(keys).then((err) => {
+ kvStore.deleteBatch(keys).then(() => {
console.info('Succeeded in deleting Batch');
}).catch((err) => {
console.error(`Failed to delete Batch.code is ${err.code},message is ${err.message}`);
@@ -2845,10 +2845,10 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) {
console.info('Succeeded in putting data');
const deviceid = 'no_exist_device_id';
- kvStore.removeDeviceData(deviceid, async function (err, data) {
+ kvStore.removeDeviceData(deviceid, async function (err) {
if (err == undefined) {
console.info('succeeded in removing device data');
} else {
@@ -2902,13 +2902,13 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-001';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((err) => {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
console.info('Succeeded in putting data');
}).catch((err) => {
console.error(`Failed to put data.code is ${err.code},message is ${err.message} `);
});
const deviceid = 'no_exist_device_id';
- kvStore.removeDeviceData(deviceid).then((err) => {
+ kvStore.removeDeviceData(deviceid).then(() => {
console.info('succeeded in removing device data');
}).catch((err) => {
console.error(`Failed to remove device data.code is ${err.code},message is ${err.message} `);
@@ -2954,7 +2954,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -3009,8 +3009,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting data.data=${data}`);
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => {
console.info(`Succeeded in getting data.data=${data}`);
}).catch((err) => {
@@ -3065,7 +3065,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -3132,7 +3132,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (entries) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries');
@@ -3190,7 +3190,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -3256,7 +3256,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -3317,7 +3317,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -3330,7 +3330,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -3391,7 +3391,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -3402,7 +3402,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -3454,7 +3454,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -3522,7 +3522,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -3583,7 +3583,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -3643,7 +3643,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -3673,7 +3673,7 @@ Closes the **KVStoreResultSet** object returned by [SingleKvStore.getResultSet](
```js
try {
let resultSet = null;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err == undefined) {
console.info('Succeeded in closing result set');
} else {
@@ -3760,7 +3760,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -3822,7 +3822,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -3867,11 +3867,11 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.backup(file, (err, data) => {
+ kvStore.backup(file, function(err) => {
if (err) {
console.error(`Failed to backup.code is ${err.code},message is ${err.message} `);
} else {
- console.info(`Succeeded in backupping data.data=${data}`);
+ console.info(`Succeeded in backupping data`);
}
});
} catch (e) {
@@ -3912,8 +3912,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.backup(file).then((data) => {
- console.info(`Succeeded in backupping data.data=${data}`);
+ kvStore.backup(file).then(() => {
+ console.info(`Succeeded in backupping data`);
}).catch((err) => {
console.error(`Failed to backup.code is ${err.code},message is ${err.message}`);
});
@@ -3950,11 +3950,11 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.restore(file, (err, data) => {
+ kvStore.restore(file, (err) => {
if (err) {
console.error(`Failed to restore.code is ${err.code},message is ${err.message}`);
} else {
- console.info(`Succeeded in restoring data.data=${data}`);
+ console.info(`Succeeded in restoring data`);
}
});
} catch (e) {
@@ -3995,8 +3995,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
let file = "BK001";
try {
- kvStore.restore(file).then((data) => {
- console.info(`Succeeded in restoring data.data=${data}`);
+ kvStore.restore(file).then(() => {
+ console.info(`Succeeded in restoring data`);
}).catch((err) => {
console.error(`Failed to restore.code is ${err.code},message is ${err.message}`);
});
@@ -4124,7 +4124,7 @@ try {
console.info(`startTransaction 0 ${data}`);
count++;
});
- kvStore.startTransaction(async function (err, data) {
+ kvStore.startTransaction(async function (err) {
if (err != undefined) {
console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`);
return;
@@ -4132,7 +4132,7 @@ try {
console.info('Succeeded in starting Transaction');
let entries = putBatchString(10, 'batch_test_string_key');
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -4182,7 +4182,7 @@ try {
console.info(`startTransaction 0 ${data}`);
count++;
});
- kvStore.startTransaction().then(async (err) => {
+ kvStore.startTransaction().then(async () => {
console.info('Succeeded in starting Transaction');
}).catch((err) => {
console.error(`Failed to start Transaction.code is ${err.code},message is ${err.message}`);
@@ -4218,7 +4218,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.commit(function (err, data) {
+ kvStore.commit(function (err) {
if (err == undefined) {
console.info('Succeeded in committing');
} else {
@@ -4256,7 +4256,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.commit().then(async (err) => {
+ kvStore.commit().then(async () => {
console.info('Succeeded in committing');
}).catch((err) => {
console.error(`Failed to commit.code is ${err.code},message is ${err.message}`);
@@ -4292,7 +4292,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.rollback(function (err,data) {
+ kvStore.rollback(function (err) {
if (err == undefined) {
console.info('Succeeded in rolling back');
} else {
@@ -4330,7 +4330,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
```js
try {
- kvStore.rollback().then(async (err) => {
+ kvStore.rollback().then(async () => {
console.info('Succeeded in rolling back');
}).catch((err) => {
console.error(`Failed to rollback.code is ${err.code},message is ${err.message}`);
@@ -4359,7 +4359,7 @@ Sets data synchronization, which can be enabled or disabled. This API uses an as
```js
try {
- kvStore.enableSync(true, function (err, data) {
+ kvStore.enableSync(true, function (err) {
if (err == undefined) {
console.info('Succeeded in enabling sync');
} else {
@@ -4395,7 +4395,7 @@ Sets data synchronization, which can be enabled or disabled. This API uses a pro
```js
try {
- kvStore.enableSync(true).then((err) => {
+ kvStore.enableSync(true).then(() => {
console.info('Succeeded in enabling sync');
}).catch((err) => {
console.error(`Failed to enable sync.code is ${err.code},message is ${err.message}`);
@@ -4427,7 +4427,7 @@ Sets the data synchronization range. This API uses an asynchronous callback to r
try {
const localLabels = ['A', 'B'];
const remoteSupportLabels = ['C', 'D'];
- kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err, data) {
+ kvStore.setSyncRange(localLabels, remoteSupportLabels, function (err) {
if (err != undefined) {
console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`);
return;
@@ -4466,7 +4466,7 @@ Sets the data synchronization range. This API uses a promise to return the resul
try {
const localLabels = ['A', 'B'];
const remoteSupportLabels = ['C', 'D'];
- kvStore.setSyncRange(localLabels, remoteSupportLabels).then((err) => {
+ kvStore.setSyncRange(localLabels, remoteSupportLabels).then(() => {
console.info('Succeeded in setting syncRange');
}).catch((err) => {
console.error(`Failed to set syncRange.code is ${err.code},message is ${err.message}`);
@@ -4496,7 +4496,7 @@ Sets the default delay allowed for KV store synchronization. This API uses an as
```js
try {
const defaultAllowedDelayMs = 500;
- kvStore.setSyncParam(defaultAllowedDelayMs, function (err, data) {
+ kvStore.setSyncParam(defaultAllowedDelayMs, function (err) {
if (err != undefined) {
console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`);
return;
@@ -4533,7 +4533,7 @@ Sets the default delay allowed for KV store synchronization. This API uses a pro
```js
try {
const defaultAllowedDelayMs = 500;
- kvStore.setSyncParam(defaultAllowedDelayMs).then((err) => {
+ kvStore.setSyncParam(defaultAllowedDelayMs).then(() => {
console.info('Succeeded in setting syncParam');
}).catch((err) => {
console.error(`Failed to set syncParam.code is ${err.code},message is ${err.message}`);
@@ -4550,7 +4550,7 @@ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void
Synchronizes the KV store manually. For details about the synchronization modes of KV stores, see [Cross-Device Synchronization of KV Stores](../../database/data-sync-of-kv-store.md).
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -4560,7 +4560,7 @@ Synchronizes the KV store manually. For details about the synchronization modes
| Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------------------------- |
-| deviceIds | string[] | Yes | List of IDs of the devices in the same networking environment to be synchronized.|
+| deviceIds | string[] | Yes | List of **networkId**s of the devices in the same networking environment to be synchronized.|
| mode | [SyncMode](#syncmode) | Yes | Synchronization mode. |
| delayMs | number | No | Allowed synchronization delay time, in ms. The default value is **0**. |
@@ -4589,14 +4589,14 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
kvStore.on('syncComplete', function (data) {
console.info('Sync dataChange');
});
- kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to sync.code is ${err.code},message is ${err.message}`);
return;
@@ -4619,7 +4619,7 @@ sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void
Synchronizes the KV store manually. This API returns the result synchronously. For details about the synchronization modes of KV stores, see [Cross-Device Synchronization of KV Stores](../../database/data-sync-of-kv-store.md).
> **NOTE**
>
-> The value of **deviceIds** is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
+> **deviceIds** is the **networkId** in [DeviceInfo](js-apis-device-manager.md#deviceinfo), which is obtained by [deviceManager.getTrustedDeviceListSync](js-apis-device-manager.md#gettrusteddevicelistsync). The APIs of the **deviceManager** module are system interfaces and available only to system applications.
**Required permissions**: ohos.permission.DISTRIBUTED_DATASYNC
@@ -4629,7 +4629,7 @@ Synchronizes the KV store manually. This API returns the result synchronously. F
| Name | Type | Mandatory| Description |
| --------- | --------------------- | ---- | ---------------------------------------------- |
-| deviceIds | string[] | Yes | List of IDs of the devices in the same networking environment to be synchronized.|
+| deviceIds | string[] | Yes | List of **networkId**s of the devices in the same networking environment to be synchronized.|
| mode | [SyncMode](#syncmode) | Yes | Synchronization mode. |
| query | [Query](#query) | Yes | **Query** object to match. |
| delayMs | number | No | Allowed synchronization delay time, in ms. The default value is **0**.|
@@ -4659,14 +4659,14 @@ deviceManager.createDeviceManager('bundleName', (err, value) => {
if (devManager != null) {
var devices = devManager.getTrustedDeviceListSync();
for (var i = 0; i < devices.length; i++) {
- deviceIds[i] = devices[i].deviceId;
+ deviceIds[i] = devices[i].networkId;
}
}
try {
kvStore.on('syncComplete', function (data) {
console.info('Sync dataChange');
});
- kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_SYNC_ELEMENT + 'testSync101', VALUE_TEST_SYNC_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to sync.code is ${err.code},message is ${err.message}`);
return;
@@ -4735,7 +4735,7 @@ Subscribes to synchronization complete events.
| Name | Type | Mandatory| Description |
| ------------ | --------------------------------------------- | ---- | ------------------------------------------------------ |
| event | string | Yes | Event to subscribe to. The value is **syncComplete**, which indicates a synchronization complete event.|
-| syncCallback | Callback<Array<[string, number]>> | Yes | Callback invoked to return the synchronization complete event.|
+| syncCallback | Callback<Array<[string, number]>> | Yes | Callback invoked to return the synchronization complete event. |
**Example**
@@ -4746,7 +4746,7 @@ try {
kvStore.on('syncComplete', function (data) {
console.info(`syncComplete ${data}`);
});
- kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then((data) => {
+ kvStore.put(KEY_TEST_FLOAT_ELEMENT, VALUE_TEST_FLOAT_ELEMENT).then(() => {
console.info('succeeded in putting');
}).catch((err) => {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
@@ -4969,7 +4969,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -5024,8 +5024,8 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then((data) => {
- console.info(`Succeeded in putting data.data=${data}`);
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(() => {
+ console.info(`Succeeded in putting data`);
kvStore.get(KEY_TEST_STRING_ELEMENT).then((data) => {
console.info(`Succeeded in getting data.data=${data}`);
}).catch((err) => {
@@ -5075,7 +5075,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err, data) {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, async function (err) {
if (err != undefined) {
console.error(`Failed to put.code is ${err.code},message is ${err.message}`);
return;
@@ -5135,7 +5135,7 @@ For details about the error codes, see [Distributed KV Store Error Codes](../err
const KEY_TEST_STRING_ELEMENT = 'key_test_string_2';
const VALUE_TEST_STRING_ELEMENT = 'value-string-002';
try {
- kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async (data) => {
+ kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT).then(async () => {
console.info('Succeeded in putting');
kvStore.get('localDeviceId', KEY_TEST_STRING_ELEMENT).then((data) => {
console.info('Succeeded in getting');
@@ -5191,7 +5191,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put Batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5258,7 +5258,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (entries) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
kvStore.getEntries('batch_test_string_key').then((entries) => {
console.info('Succeeded in getting Entries');
@@ -5320,7 +5320,7 @@ try {
entries.push(entry);
}
console.info(`entries : ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5392,7 +5392,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
kvStore.getEntries('localDeviceId', 'batch_test_string_key').then((entries) => {
console.info('Succeeded in getting entries');
@@ -5453,7 +5453,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -5519,7 +5519,7 @@ try {
entries.push(entry);
}
console.info(`entries: {entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting Batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -5584,7 +5584,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5661,7 +5661,7 @@ try {
entries.push(entry);
}
console.info(`entries: ${entries}`);
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
var query = new distributedKVStore.Query();
query.deviceId('localDeviceId');
@@ -5722,7 +5722,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5735,7 +5735,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -5796,7 +5796,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -5807,7 +5807,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -5859,7 +5859,7 @@ try {
}
console.info('Succeeded in getting resultSet');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return;
@@ -5918,7 +5918,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultSet.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing resultSet');
}).catch((err) => {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
@@ -5975,7 +5975,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -5990,7 +5990,7 @@ try {
}
console.info('Succeeded in getting resultSet');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return;
@@ -6056,7 +6056,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -6071,7 +6071,7 @@ try {
});
query.deviceId('localDeviceId');
console.info("GetResultSet " + query.getSqlLike());
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing resultSet');
}).catch((err) => {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
@@ -6129,7 +6129,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -6194,7 +6194,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -6209,7 +6209,7 @@ try {
}
console.info('Succeeded in getting resultSet');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultSet.code is ${err.code},message is ${err.message}`);
return;
@@ -6266,7 +6266,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -6326,7 +6326,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -6384,7 +6384,7 @@ try {
}
console.info('Succeeded in getting result set');
resultSet = result;
- kvStore.closeResultSet(resultSet, function (err, data) {
+ kvStore.closeResultSet(resultSet, function (err) {
if (err != undefined) {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
return;
@@ -6449,7 +6449,7 @@ try {
}).catch((err) => {
console.error(`Failed to get resultset.code is ${err.code},message is ${err.message}`);
});
- kvStore.closeResultSet(resultSet).then((err) => {
+ kvStore.closeResultSet(resultSet).then(() => {
console.info('Succeeded in closing result set');
}).catch((err) => {
console.error(`Failed to close resultset.code is ${err.code},message is ${err.message}`);
@@ -6499,7 +6499,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
console.info('Succeeded in putting batch');
const query = new distributedKVStore.Query();
query.prefixKey("batch_test");
@@ -6561,7 +6561,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
@@ -6623,7 +6623,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries, async function (err, data) {
+ kvStore.putBatch(entries, async function (err) {
if (err != undefined) {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
return;
@@ -6695,7 +6695,7 @@ try {
}
entries.push(entry);
}
- kvStore.putBatch(entries).then(async (err) => {
+ kvStore.putBatch(entries).then(async () => {
console.info('Succeeded in putting batch');
}).catch((err) => {
console.error(`Failed to put batch.code is ${err.code},message is ${err.message}`);
diff --git a/en/application-dev/reference/apis/js-apis-hisysevent.md b/en/application-dev/reference/apis/js-apis-hisysevent.md
index b61207a81a9be58f9b8b405535e118757218529e..a22ad94185be68c527e40162d8409d2623b4cd8a 100644
--- a/en/application-dev/reference/apis/js-apis-hisysevent.md
+++ b/en/application-dev/reference/apis/js-apis-hisysevent.md
@@ -3,6 +3,7 @@
The **hiSysEvent** module provides the system event logging functions, such as configuring trace points, subscribing to system events, and querying system events written to the event file.
> **NOTE**
+>
> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - The APIs provided by this module are system APIs.
@@ -312,6 +313,8 @@ Defines arguments for an event query.
| beginTime | number | Yes| Start time (13-digit timestamp) for the event query.|
| endTime | number | Yes| End time (13-digit timestamp) for the event query.|
| maxEvents | number | Yes| Maximum number of events that can be queried.|
+| fromSeq10+ | number | No | Start SN of the events to be queried. The default value is **-1**.|
+| toSeq10+ | number | No | End SN of the system events to be queried. The default value is **-1**.|
## QueryRule
@@ -323,6 +326,7 @@ Defines event query rules.
| -------- | -------- | -------- | -------- |
| domain | string | Yes| Event domain.|
| names | string[] | Yes| Array of event names. A **QueryRule** object contains multiple system event names.|
+| condition10+ | string | No| Additional event conditions. The value of this parameter is in the format of {"version":"V1","condition":{"and":[{"param":"*Parameter*","op":"*Operator*","value":"*Comparison value*"}]}}.|
## Querier
@@ -403,3 +407,197 @@ try {
console.error(`error code: ${error.code}, error msg: ${error.message}`);
}
```
+
+## hiSysEvent.exportSysEvents10+
+
+exportSysEvents(queryArg: QueryArg, rules: QueryRule[]): number
+
+Exports system events in batches and writes them as a file to the fixed directory of the application sandbox (that is, **/data/storage/el2/base/cache/hiview/event/**).
+
+**Required permission**: ohos.permission.READ_DFX_SYSEVENT
+
+**System capability**: SystemCapability.HiviewDFX.HiSysEvent
+
+**Parameters**
+
+| Name | Type | Mandatory| Description |
+| -------- | ------------------------- | ---- | ------------------------------------------ |
+| queryArg | [QueryArg](#queryarg) | Yes | Event query parameters for the export. |
+| rules | [QueryRule](#queryrule)[] | Yes | Array of event query rules for the export.|
+
+**Return value**
+
+| Type | Description |
+| ------ | ---------------- |
+| number | API call timestamp.|
+
+**Error codes**
+
+For details about the error codes, see [HiSysEvent Error Codes](../errorcodes/errorcode-hisysevent.md).
+
+| ID| Error Message |
+| -------- | ----------------------------------- |
+| 11200301 | Count of query rules is over limit. |
+| 11200302 | Invalid query rule. |
+| 11200304 | Export frequency is over limit. |
+
+**Example**
+
+```
+import hiSysEvent from '@ohos.hiSysEvent';
+import fs from '@ohos.file.fs';
+
+try {
+ hiSysEvent.write({
+ domain: "RELIABILITY",
+ name: "STACK",
+ eventType: hiSysEvent.EventType.FAULT,
+ params: {
+ PID: 487,
+ UID: 103,
+ PACKAGE_NAME: "com.ohos.hisysevent.test",
+ PROCESS_NAME: "syseventservice",
+ MSG: "no msg."
+ }
+ }, (err, val) => {
+ // do something here.
+ })
+
+ let time = hiSysEvent.exportSysEvents({
+ beginTime: -1,
+ endTime: -1,
+ maxEvents: 1,
+ }, [{
+ domain: "RELIABILITY",
+ names: ["STACK"],
+ }])
+ console.log(`receive export task time is : ${time}`);
+
+ // Postpone reading of exported events.
+ setTimeout(function() {
+ let eventDir = '/data/storage/el2/base/cache/hiview/event';
+ let filenames = fs.listFileSync(eventDir);
+ for (let i = 0; i < filenames.length; i++) {
+ if (filenames[i].indexOf(time.toString()) != -1) {
+ let res = fs.readTextSync(eventDir + '/' + filenames[i]);
+ let events = JSON.parse('[' + res.slice(0, res.length - 1) + ']');
+ console.log("read file end, events is :" + JSON.stringify(events));
+ }
+ }
+ }, 10000)
+} catch (error) {
+ console.error(`error code: ${error.code}, error msg: ${error.message}`);
+}
+```
+
+## hiSysEvent.subscribe10+
+
+subscribe(rules: QueryRule[]): number
+
+Subscribes to real-time system events that occur occasionally or occur in a low frequency. These events are written as a file to the fixed directory of the application sandbox (that is, **/data/storage/el2/base/cache/hiview/event/**).
+
+**Required permission**: ohos.permission.READ_DFX_SYSEVENT
+
+**System capability**: SystemCapability.HiviewDFX.HiSysEvent
+
+**Parameters**
+
+| Name| Type | Mandatory| Description |
+| ------ | ------------------------- | ---- | ------------------------------------------ |
+| rules | [QueryRule](#queryrule)[] | Yes | Array of event query rules for the subscription.|
+
+**Return value**
+
+| Type | Description |
+| ------ | ---------------- |
+| number | API call timestamp.|
+
+**Error codes**
+
+For details about the error codes, see [HiSysEvent Error Codes](../errorcodes/errorcode-hisysevent.md).
+
+| ID| Error Message |
+| -------- | ----------------------------------- |
+| 11200301 | Count of query rules is over limit. |
+| 11200302 | Invalid query rule. |
+
+**Example**
+
+```
+import hiSysEvent from '@ohos.hiSysEvent';
+import fs from '@ohos.file.fs';
+
+try {
+ hiSysEvent.subscribe([{
+ domain: "RELIABILITY",
+ names: ["STACK"],
+ },{
+ domain: "BUNDLE_MANAGER",
+ names: ["BUNDLE_UNINSTALL"],
+ }])
+ hiSysEvent.write({
+ domain: "RELIABILITY",
+ name: "STACK",
+ eventType: hiSysEvent.EventType.FAULT,
+ params: {
+ PID: 487,
+ UID: 103,
+ PACKAGE_NAME: "com.ohos.hisysevent.test",
+ PROCESS_NAME: "syseventservice",
+ MSG: "no msg."
+ }
+ }, (err, val) => {
+ // do something here.
+ })
+
+ // Postpone reading of subscribed events.
+ setTimeout(function() {
+ let eventDir = '/data/storage/el2/base/cache/hiview/event';
+ let filenames = fs.listFileSync(eventDir);
+ for (let i = 0; i < filenames.length; i++) {
+ let res = fs.readTextSync(eventDir + '/' + filenames[i]);
+ let events = JSON.parse('[' + res.slice(0, res.length - 1) + ']');
+ console.log("read file end, events is :" + JSON.stringify(events));
+ }
+ }, 10000)
+} catch (error) {
+ console.error(`error code: ${error.code}, error msg: ${error.message}`);
+}
+```
+
+## hiSysEvent.unsubscribe10+
+
+unsubscribe(): void
+
+Unsubscribes from system events.
+
+**Required permission**: ohos.permission.READ_DFX_SYSEVENT
+
+**System capability**: SystemCapability.HiviewDFX.HiSysEvent
+
+**Error codes**
+
+For details about the error codes, see [HiSysEvent Error Codes](../errorcodes/errorcode-hisysevent.md).
+
+| ID| Error Message |
+| -------- | ------------------- |
+| 11200305 | Unsubscribe failed. |
+
+**Example**
+
+```
+import hiSysEvent from '@ohos.hiSysEvent';
+
+try {
+ hiSysEvent.subscribe([{
+ domain: "RELIABILITY",
+ names: ["STACK"],
+ },{
+ domain: "BUNDLE_MANAGER",
+ names: ["BUNDLE_UNINSTALL","BUNDLE_INSTALL"],
+ }])
+ hiSysEvent.unsubscribe();
+} catch (error) {
+ console.error(`error code: ${error.code}, error msg: ${error.message}`);
+}
+```
diff --git a/en/application-dev/reference/apis/js-apis-http.md b/en/application-dev/reference/apis/js-apis-http.md
index 9f49f9bb61eda42dfc3232ac545f6d080aa3758e..43c785c8741fae614d2d77b6c88829f4b62c58ab 100644
--- a/en/application-dev/reference/apis/js-apis-http.md
+++ b/en/application-dev/reference/apis/js-apis-http.md
@@ -16,7 +16,7 @@ import http from '@ohos.net.http';
## Examples
```js
-// Import the http namespace.
+// Import the HTTP namespace.
import http from '@ohos.net.http';
// Each httpRequest corresponds to an HTTP request task and cannot be reused.
@@ -35,17 +35,17 @@ httpRequest.request(
header: {
'Content-Type': 'application/json'
},
- // This parameter is used to transfer data when the POST request is used.
+ // This field is used to transfer data when the POST request is used.
extraData: {
"data": "data to send",
},
- expectDataType: http.HttpDataType.STRING, // Optional. This parameter specifies the type of the return data.
+ expectDataType: http.HttpDataType.STRING, // Optional. This field specifies the type of the return data.
usingCache: true, // Optional. The default value is true.
priority: 1, // Optional. The default value is 1.
connectTimeout: 60000 // Optional. The default value is 60000, in ms.
readTimeout: 60000, // Optional. The default value is 60000, in ms.
usingProtocol: http.HttpProtocol.HTTP1_1, // Optional. The default protocol type is automatically specified by the system.
- usingProxy: false, // Optional. By default, network proxy is not used. This field is supported since API version 10.
+ usingProxy: false, // Optional. By default, network proxy is not used. This field is supported since API 10.
caPath: "", // Optional. The preset CA certificate is used by default. This field is supported since API version 10.
}, (err, data) => {
if (!err) {
@@ -55,6 +55,8 @@ httpRequest.request(
// data.header carries the HTTP response header. Parse the content based on service requirements.
console.info('header:' + JSON.stringify(data.header));
console.info('cookies:' + JSON.stringify(data.cookies)); // 8+
+ // Call the destroy() method to release resources after HttpRequest is complete.
+ httpRequest.destroy();
} else {
console.info('error:' + JSON.stringify(err));
// Unsubscribe from HTTP Response Header events.
@@ -73,7 +75,7 @@ httpRequest.request(
createHttp(): HttpRequest
-Creates an HTTP request. You can use this API to initiate or destroy an HTTP request, or enable or disable listening for HTTP Response Header events. An **HttpRequest** object corresponds to an HTTP request. To initiate multiple HTTP requests, you must create an **HttpRequest** object for each HTTP request.
+Creates an HTTP request. You can use this API to initiate or destroy an HTTP request, or enable or disable listening for HTTP Response Header events. An HttpRequest object corresponds to an HTTP request. To initiate multiple HTTP requests, you must create an **HttpRequest** object for each HTTP request.
**System capability**: SystemCapability.Communication.NetStack
@@ -432,7 +434,7 @@ httpRequest.request2("EXAMPLE_URL", (err, data) => {
request2(url: string, options: HttpRequestOptions, callback: AsyncCallback\): void
-Initiates an HTTP request containing specified options to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response.
+Initiates an HTTP request to a given URL. This API uses an asynchronous callback to return the result, which is a streaming response.
**Required permissions**: ohos.permission.INTERNET
@@ -567,7 +569,7 @@ Initiates an HTTP request containing specified options to a given URL. This API
> **NOTE**
> For details about the error codes, see [HTTP Error Codes](../errorcodes/errorcode-net-http.md).
-> The HTTP error code mapping is in the format of 2300000 + Curl error code. For more common error codes, see [Curl Error Codes](https://curl.se/libcurl/c/libcurl-errors.html).
+> The HTTP error code mapping is in the format of 2300000 + Curl error code. For more common error codes, see:
**Example**
@@ -594,7 +596,7 @@ on(type: 'headerReceive', callback: AsyncCallback\